hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Sending HTTP/1.1 trailers

Open seanmonstar opened this issue 3 years ago • 1 comments

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 (is None), check the body for trails poll_trailers.
    • It might be we want to add some state to the dispatcher like Wants::TRAILERS, if we received a request with TE: 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.
  • Add proto::h1::Conn::write_trailers() after write_body(). The dispatcher would call this.
  • Add proto::h1::Encoder::encode_trailers() that flattens the HeaderMap into a Buf.
    • A few unit tests for encoding trailers in the encode file.
  • A couple tests, at least one in each of tests/client.rs and tests/server.rs that both sides can send trailers.

seanmonstar avatar Dec 10 '21 00:12 seanmonstar

@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!

seanmonstar avatar Jan 28 '22 23:01 seanmonstar