-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
100-continue response with BodyStream impossible #3827
Comments
Doesn't this test imply this handling still exists? Lines 876 to 907 in e981a91
|
I believe this handling is only triggered when it is using the function |
Which poll function? Are you sure that poll_frame doesn't call down into that poll function? Could you put together a self contained example that shows the issue? |
Version
Hyper 1.5 server (HTTP1 mode)
Description
Hey there, Hyper team! I've run into a bit of a pickle with Hyper 1.5 and the handling of 100-continue responses. Let me break it down:
The newer streaming API (BodyStream) doesn't trigger an automatic 100-continue informational response when a data frame is polled. This is different from the older Body API, which sends the 100-continue when the body is first polled.
Trying to send a 100-continue response manually in the application using
return Ok(Response::new(Body::empty()))
results in a runtime error:UnsupportedStatusCode
. This leaves us in a bit of a bind.I've seen suggestions to inject the response at the TCP layer, but that's pretty awkward, especially when using TLS encryption. It feels like we're working against the library rather than with it.
I'm curious why the logic that works for Body and the older API (as described in PR #2119, which added automatic 100-continue support for Body) doesn't work with BodyStream. That PR essentially made Hyper automatically send a 100-continue response when the body is first polled if the request included an Expect: 100-continue header.
Would it be possible to implement support for the 100-continue response using the body streaming interface in the same way as it's done for Body? It seems like this would provide a consistent experience across both APIs.
I noticed PR #3815, which adds support for sending informational responses. Will this solve the problem? It looks like it adds a
send_informational
method to the response, but I'm not sure if this will integrate with the automatic 100-continue behavior.Thanks for your time, and I'm looking forward to hearing your thoughts on this!
Related
Expect: 100-continue
statement #369100 Continue
if request body is polled #2119The text was updated successfully, but these errors were encountered: