goproxy
goproxy copied to clipboard
Allow non-cannonical headers
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!
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!
Sure, would be happy for a PR
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