Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per RFC 9110, 10.1.1: If a request has
Expect: 100-continue, the server should either send100 Continueto say it is ready for the request body, or send a final status such as417 Expectation Failed.The HTTP/1 server handles this correctly: it sends
100 Continuethe first time the service polls the request body. However, the HTTP/2 server ignoresExpect, so a client that waits for100 Continuebefore sending its body stalls until its own timeout.Fix this by making the HTTP/2 server send
100 Continueafter 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 the100 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