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/http: Redirect unresponding for URL containing Unicode #4385
Comments
Comment 6 by rick@boat-rockers.com: I did some investigation on this issue: https://groups.google.com/forum/?fromgroups=#!topic/golang-dev/Ml2QNDq9ElM tl;dr - I couldn't reproduce it but escaping chars > 0x7F is required by the spec. I can think of 3 options to fix this issue: 1) Handle encoding of the redirect Location header only 2) Automatically encode/decode all HTTP headers (to enforce the spec consistently) 3) Don't change code but document that users should make sure to encode/decode if necessary What is your preference? |
With the latest tip this seems to be working fine, unicode or not doesn't seem to be a problem anymore.
Will just add a test case to make sure that its validated all the time. |
CL https://golang.org/cl/18732 mentions this issue. |
I'm not sure https://golang.org/cl/18732 is correct. It seems like there should be some escaping happening. I don't think UTF-8 is allowed in headers. Even if this "works" right now, it's just us testing our own misbehavior probably. Any change needs to cite relevant parts of specs. |
You are right UTF-8 is not allowed.
From what i can read they should be escaped while doing a redirect since Location header is a URI. Not sure why it isn't happening though. Will see why this is not happening. |
CL https://golang.org/cl/31732 mentions this issue. |
by hip80763:
The text was updated successfully, but these errors were encountered: