Skip to content

It cause error when I use http client to do the http2 request #3676

Answered by seanmonstar
lsk569937453 asked this question in Q&A
Discussion options

You must be logged in to vote

I suspect it's this line: https://github.com/lsk569937453/rcurl/blob/9bb784aec1c45cbc9f5c51106ad8abe6b0ff56db/src/http/handler.rs#L236

While sending a host header over HTTP/2 isn't forbidden (and thus hyper allows it), some servers choose to call it a PROTOCOL_ERROR (it's not, they're wrong). However, it is true that you don't need to send it, since hyper's legacy client will automatically send the correct :authority header for you.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@seanmonstar
Comment options

Answer selected by lsk569937453
@lsk569937453
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
C-bug Category: bug. Something is wrong. This is bad!
2 participants
Converted from issue

This discussion was converted from issue #3675 on May 27, 2024 12:20.