-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/url: RequestURI encoded path should not encode '!' #6784
Labels
Comments
see http://play.golang.org/p/X6LGcNbHzA, it's more obvious. it's affected by all struts2 framework, it's serious. |
Here is a smaller reproduction, http://play.golang.org/p/xPQ61lbUqE The bone of contention is the encoding of !. I am not sure if this is a problem or not. |
The https://www.shipin7.com/user/userAction%21goRegister.action page is incorrect. https://www.shipin7.com/user/userAction!goRegister.action page is ok. you can compare above in Browser. http.Client.Do(), http.Get() internal encode '!' and send whole Request to server. I think '!' should not encode because of RFC3986 |
In RFC 2396: reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," unreserved = alphanum | mark mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" In RFC 3986: reserved = gen-delims / sub-delims gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" https://code.google.com/p/go/source/detail?r=6b46fb967ca4a48caf486f4452c4358251f91aad The CL above only removes !*\() from unreserved part(the \ may be wrong, it should be "'"), but doesn't add []!'()* to the reserved part. So I think it's a bug. |
This also triggers with the hashbang style single-page web app url fragments: http://play.golang.org/p/-kx5yULrzl u, err := url.Parse("http://foo.bar/#!quux") // http://foo.bar/#%21quux See https://developers.google.com/webmasters/ajax-crawling/ for more. |
https://golang.org/cl/31400043/ Does anyone know why ! is left out in the first place? was that intentional? Status changed to Started. |
Some examples of URLs where parentheses don't work if they're escaped: http://web.signaltiretrader.com/(S(5iexcz551ptpgo45g03mgz45))/Themes/css/ploneColumns.css and the LinkedIn API URLs discussed at https://groups.google.com/forum/#!searchin/golang-nuts/url$20escaping/golang-nuts/Mro8TGrb3y8/eW8QCx_iFYMJ |
jkbbwr on IRC pointed out that slashes in queries get quoted too: http://play.golang.org/p/EiRhkOT8im Relevant RFC: http://tools.ietf.org/html/rfc3986#section-3.4 |
Referenced on StackOverflow: http://stackoverflow.com/questions/20847357/golang-http-client-always-escaped-the-url/ |
Status changed to Duplicate. Merged into issue #5684. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: