hyper
hyper copied to clipboard
Sending HTTP/1.1 trailers
Here's a list of pieces needed to make this work:
- Update
proto::h1::Dispatcher::poll_write()so that when all data items are done (isNone), check the body for trailspoll_trailers.- It might be we want to add some state to the dispatcher like
Wants::TRAILERS, if we received a request withTE: trailers. This could be useful to skip checking for trailers if the request never said it supports them. - It's likely that new state will need to be added, in case the data is done, but polling the trailers is
Pending.
- It might be we want to add some state to the dispatcher like
- Add
proto::h1::Conn::write_trailers()afterwrite_body(). The dispatcher would call this. - Add
proto::h1::Encoder::encode_trailers()that flattens theHeaderMapinto aBuf.- A few unit tests for encoding trailers in the
encodefile.
- A few unit tests for encoding trailers in the
- A couple tests, at least one in each of
tests/client.rsandtests/server.rsthat both sides can send trailers.
@Xuanwo I've updated the issue above to include a list of things I think that needs to be done. If anything is missing, we can add more instructions here!