Repository navigation
fix(server): prevent sending 100-continue if user drops request body - #3137
Merged
Merged
Conversation
sfackler
reviewed
Feb 1, 2023
sfackler
approved these changes
Feb 1, 2023
0xE282B0
pushed a commit
to 0xE282B0/hyper
that referenced
this pull request
Jan 12, 2024
0xE282B0
pushed a commit
to 0xE282B0/hyper
that referenced
this pull request
Jan 16, 2024
…yperium#3137) Signed-off-by: Sven Pfennig <[email protected]>
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
If a client request has an `Expect: 100-continue` header, the server is supposed to answer with either a `100 Continue` to indicate it is ready to receive the rest of the request content, or a final status like `417 Expectation Failed` to indicate it cannot meet the expectation. See RFC 9110 §10.1.1 for details. The HTTP/1 server handles this correctly. It sends `100 Continue` the first time it polls the body of a request that has `Expect: 100-continue`, provided no response has started (see hyperium#2119 and hyperium#3137). However, the HTTP/2 server currently ignores `Expect`. So a client that waits for the `100 Continue` before sending its body stalls until its own timeout. Fix this by implementing the same behavior as the HTTP/1 server: send `100 Continue` the first time the body of the request is polled.
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
If a client request has an `Expect: 100-continue` header, the server is supposed to answer with either a `100 Continue` to indicate it is ready to receive the rest of the request content, or a final status like `417 Expectation Failed` to indicate it cannot meet the expectation. See RFC 9110 §10.1.1 for details. The HTTP/1 server handles this correctly. It sends `100 Continue` the first time it polls the body of a request that has `Expect: 100-continue`, provided no response has started (see hyperium#2119 and hyperium#3137). However, the HTTP/2 server currently ignores `Expect`. So a client that waits for the `100 Continue` before sending its body stalls until its own timeout. Fix this by implementing the same behavior as the HTTP/1 server: send `100 Continue` the first time the body of the request is polled. Fixes hyperium#2743
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
If a client request has an `Expect: 100-continue` header, the server is supposed to answer with either a `100 Continue` to indicate it is ready to receive the rest of the request content, or a final status like `417 Expectation Failed` to indicate it cannot meet the expectation. See RFC 9110 §10.1.1 for details. The HTTP/1 server handles this correctly. It sends `100 Continue` the first time it polls the body of a request that has `Expect: 100-continue`, provided no response has started (see hyperium#2119 and hyperium#3137). However, the HTTP/2 server currently ignores `Expect`. So a client that waits for the `100 Continue` before sending its body stalls until its own timeout. Fix this by implementing the same behavior as the HTTP/1 server: send `100 Continue` the first time the body of the request is polled. Fixes hyperium#2743
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
If a client request has an `Expect: 100-continue` header, the server is supposed to answer with either a `100 Continue` to indicate it is ready to receive the rest of the request content, or a final status like `417 Expectation Failed` to indicate it cannot meet the expectation. See RFC 9110 §10.1.1 for details. The HTTP/1 server handles this correctly. It sends `100 Continue` the first time it polls the body of a request that has `Expect: 100-continue`, provided no response has started (see hyperium#2119 and hyperium#3137). However, the HTTP/2 server currently ignores `Expect`. So a client that waits for the `100 Continue` before sending its body stalls until its own timeout. Fix this by implementing the same behavior as the HTTP/1 server: send `100 Continue` the first time the body of the request is polled. Fixes hyperium#2743
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
If a client request has an `Expect: 100-continue` header, the server is supposed to answer with either a `100 Continue` to indicate it is ready to receive the rest of the request content, or a final status like `417 Expectation Failed` to indicate it cannot meet the expectation. See RFC 9110 §10.1.1 for details. The HTTP/1 server handles this correctly. It sends `100 Continue` the first time it polls the body of a request that has `Expect: 100-continue`, provided no response has started (see hyperium#2119 and hyperium#3137). However, the HTTP/2 server currently ignores `Expect`. So a client that waits for the `100 Continue` before sending its body stalls until its own timeout. Fix this by sending `100 Continue` the first time the service polls the body of the request and has to wait for it, provided no response has started. Unlike the HTTP/1 server, the `100 Continue` is omitted if the content has already arrived by then, which RFC 9110 allows. As with HTTP/1, a service that responds before polling the body of the request (for example, one that echoes it back as the response body) never triggers a `100 Continue`, since an interim response cannot follow the final one. Fixes hyperium#2743 Co-Authored-By: Claude Opus 5.5 <[email protected]>
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
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`. See RFC 9110 §10.1.1. 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 one. Fixes hyperium#2743 Refs: hyperium#2119, hyperium#3137
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
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
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
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
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 1, 2026
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
1 task done
grosskur
added a commit
to grosskur/hyper
that referenced
this pull request
Oct 2, 2026
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 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.
No description provided.