You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a prototype intended to spur discussion about what support for 1xx
informational responses should look like in a Hyper server. The good news is
that it works great (for HTTP/1 only, so far). The bad news is it's kind of
ugly. Here's what I did:
- Add `ext::InformationalSender`, a type which wraps a
`futures_channel::mspc::Sender<Response<()>>`. This may be added as an
extension to an inbound `Request` by the Hyper server, and the application
and/or middleware may use it to send one or more informational responses
before sending the real one.
- Add code to `proto::h1::dispatch` and friends to add such an extension to each
inbound request and then poll the `Receiver` end along with the future
representing the final response. If the app never sends any informational
responses, then everything proceeds as normal. Otherwise, we send those
responses as they become available until the final response is ready.
TODO items:
- [ ] Also support informational responses in the HTTP/2 server.
- [ ] Determine best way to handle when the app sends an informational response
with a non-1xx status code. Currently we just silently ignore it.
- [ ] Come up with a less hacky API?
- [ ] Add test coverage.
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
0 commit comments