hyperium / http

Rust HTTP types
Apache License 2.0
1.14k stars 284 forks source link

Bug with some proxies when using reqwest (reqwest is based on http underhood) #535

Closed chirok11 closed 2 years ago

chirok11 commented 2 years ago

Hello. I have reached some HTTP proxies with authorization, which require http header names written as it's written in RFC. when I am sending request by netcat

`GET http://site/ HTTP/1.1 proxy-authorization: Basic abcdef== User-Agent: curl/7.79.1 Accept: / Proxy-Connection: Keep-Alive

HTTP/1.1 504 Gateway Timeout Date: Sun, 27 Mar 2022 10:17:59 GMT Content-Type: text/plain; charset=utf-8 X-Content-Type-Options: nosniff Connection: close`

but if I'll type capitalized ("Proxy-Authorization") as it wrote in RFC, then it will work without 504 gateway timeout error. So question is - maybe you should rewrite name.rs file and replace all names with correct names from RFC? I know that headers is case-insensitive, but it's normal practice to capitalize each word.

seanmonstar commented 2 years ago

This has been discussed several times before, see https://github.com/hyperium/http/issues/228#issuecomment-404996755 for the current thinking.