goproxy icon indicating copy to clipboard operation
goproxy copied to clipboard

Allow non-cannonical headers

Open physics-sec opened this issue 4 years ago • 3 comments

Hi! When you copy the headers, using copyHeaders here, you use the Add method, which is defined here (line 27).

The "issue" is that Add canonicalizes the the headers as explained here.
This is fine for the most part, but it would be really cool to allow non-cannonical headers by passing some flag to the proxy initialization.

In order to do that, instead of using Add or Set, assign to the map directly. As stated here (line 35).

I hope you would consider it.
Thank you!

physics-sec avatar Sep 21 '20 03:09 physics-sec

Hi. I would also like to see this happening. We have some third-party client libraries that are not tolerant to case change in headers (I know that is wrong, as per the HTTP specification, they should not rely in case). Would you consider a PR for this?

Thanks!

alfonso-presa avatar Jun 08 '22 20:06 alfonso-presa

Sure, would be happy for a PR

elazarl avatar Jun 08 '22 21:06 elazarl

Hi @elazarl,

trying to change this, the issue is not in the Add inside goproxy but on the httpclient itself that is making the header names cannonical. So that has to be fixed before changing goproxy behaviour.... and it doesn't seem to be happening in the sort term: https://github.com/golang/go/issues/37834

alfonso-presa avatar Jun 09 '22 08:06 alfonso-presa