Skip to content

fix(http2): send "100 Continue" on the server - #4217

Open
grosskur wants to merge 1 commit into
hyperium:masterfrom
grosskur:grosskur/h2-expect-continue
Open

grosskur wants to merge 1 commit into
hyperium:masterfrom
grosskur:grosskur/h2-expect-continue

Conversation

@grosskur

@grosskur grosskur commented Oct 1, 2026 •

Copy link
Copy Markdown

Per RFC 9110, 10.1.1: If a request has Expect: 100-continue, the server should either send 100 Continue to say it is ready for the request body, or send a final status such as 417 Expectation Failed.

The HTTP/1 server handles this correctly: it sends 100 Continue the first time the service polls the request body. However, the HTTP/2 server ignores Expect, so a client that waits for 100 Continue before sending its body stalls until its own timeout.

Fix this by making the HTTP/2 server send 100 Continue after the service first polls the request body. Note that if the body has already started arriving by then, this means the client did not wait, so we skip the 100 Continue (which RFC 9110 allows). As with HTTP/1, nothing is sent if the request has no body, or if the service responds before polling the body, since an interim response cannot follow the final response.

Fixes #2743
Refs: #2119, #3137

Per RFC 9110, 10.1.1: If a request has `Expect: 100-continue`, the
server should either send `100 Continue` to say it is ready for the
request body, or send a final status such as `417 Expectation Failed`.

The HTTP/1 server handles this correctly: it sends `100 Continue` the
first time the service polls the request body. However, the HTTP/2
server ignores `Expect`, so a client that waits for `100 Continue`
before sending its body stalls until its own timeout.

Fix this by making the HTTP/2 server send `100 Continue` after the
service first polls the request body. Note that if the body has
already started arriving by then, this means the client did not wait,
so we skip the `100 Continue` (which RFC 9110 allows). As with HTTP/1,
nothing is sent if the request has no body, or if the service responds
before polling the body, since an interim response cannot follow the
final response.

Fixes hyperium#2743
Refs: hyperium#2119, hyperium#3137

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expect: 100-continue not implemented for HTTP/2

1 participant