-
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: http://a,b,c/foo parses and reencodes as http://a%2Cb%2Cc/foo #12036
Comments
@liviosoares, suppose that mongodb://ip1,ip2,ip3 parses and reencodes as mongodb://ip1%2Cip2%2Cip3. Why is that a problem? They mean the same thing. The only way I can see this being a problem is if mongodb is using raw string manipulation instead of url.Parse. In that case it should probably be using url.Parse. |
@cespare Thank you, I have edited the top comment to remove mention of database/sql. In that case, though, I'm even more confused. What's url.Parse'ing and reencoding the URLs and then handing them to something that doesn't url.Parse them? |
@mikioh, I'm having a hard time understanding why shouldEscape behaves as it does for mode==escapeHost. Simplifying, it says:
So:
but the relevant parts of RFC 3986 say:
If the host allows all of those sub-delims, why does shouldEscape return true for all of them? The only thing it returns false for is ":", which ironically isn't allowed (but it is part of IPv6 syntax and the :port suffix, which is why it's allowed). But why do we force escaping of the sub-delim case? It seems like we should allow them all to be used unencoded. That is, |
My bad, because I didn't want to dive into the long standing issue #5684. |
Nope, the line
includes both gen-delims and sub-delims partially. |
CL https://golang.org/cl/13254 mentions this issue. |
This affects mongodb, which uses net/url to parse URLs. See @liviosoares's comments on #12023.
The text was updated successfully, but these errors were encountered: