Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/textproto: allow manually register canonicalMIMEHeaderKey #22864

Closed
j16sdiz opened this issue Nov 24, 2017 · 4 comments
Closed

net/textproto: allow manually register canonicalMIMEHeaderKey #22864

j16sdiz opened this issue Nov 24, 2017 · 4 comments

Comments

@j16sdiz
Copy link

j16sdiz commented Nov 24, 2017

This is a feature request related to #18476 #18196 #5022 #18495.
Instead of controlling each request/response, may we have a function to register my own canonicalMIMEHeaderKey ?

The HTTP problem "will be" solved with HTTP/2, but MIME is more then just HTTP.
Instead of one-header at a time, may be we can have something easier to override?

@bradfitz
Copy link
Contributor

What's the problem?

@j16sdiz
Copy link
Author

j16sdiz commented Nov 24, 2017

Legacy, standard noncompliance client that do header in case sensitive way?

I am doing a mitm proxy for a binaryonly app to inject a auth header for our internal firewall.
When I get the header, the case is not preserved and broke the legacy app.

Apache mod_proxy, nginx, squid all do that in case preserving way. But there is no way to do this in go without rewriting the whole Round Tripper.

@j16sdiz
Copy link
Author

j16sdiz commented Nov 24, 2017

I saw the previous proposal to control the case of header have been rejected.
That's why I am proposing an alternative way to do this -- allow adding my own entry to the hardcoded list.

@ianlancetaylor ianlancetaylor changed the title Allow manually register canonicalMIMEHeaderKey net/textproto: allow manually register canonicalMIMEHeaderKey Nov 24, 2017
@ianlancetaylor
Copy link
Contributor

We aren't going to add new API to the standard library to support legacy clients that are not standards compliant. You will have to make your own copy of the net/textproto package, or run a transformation on the input stream.

@golang golang locked and limited conversation to collaborators Mar 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants