Skip to content
Discussion options

You must be logged in to vote

@Scripter17 this is a timing issue in hyper's 100-continue mechanism. it's not a bug, just a consequence of your handler's architecture.

why it happens: hyper automatically sends 100 Continue when the request body is first polled via poll_frame, but only if the response headers haven't been written yet (Writing::Init state). in your handler, you move the body into tokio::spawn and return a streaming response immediately. hyper sees the response is ready, writes the 200 headers (Writing transitions to Body), and by the time your spawned task polls the body, the Writing::Init check in poll_read_body fails and 100-continue is skipped.

extractors like Bytes or Json work because they consume t…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jplatte
Comment options

Comment options

You must be logged in to vote
4 replies
@Scripter17
Comment options

@mladedav
Comment options

@Scripter17
Comment options

@sunnypatell
Comment options

Answer selected by Scripter17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants