Join GitHub today
net/url: Parse does not permit percent escapes in host #30844
RFC 3986 permits percent-encoded characters in the host part of a URL.
Applications like PostgreSQL that use
What version of Go are you using (
In addition, both "<" and ">" are allowed in host (specifically registered name) when they shouldn't be as per: https://tools.ietf.org/html/rfc3986#section-3.2.2
This should pct-encode the ">", but doesn't:
@zombiezen I wrote a test with your expected result, and I got it passing by removing a check here:
The note on the if branch mentions page 21 of that same RFC that you've linked: https://github.com/golang/go/blob/master/src/net/url/url.go#L215-L220
I think this is the relevant bit:
Not sure how to interpret the RFC, but happy to hear your thoughts.
Also worth noticing that some tests are actually checking the opposite behaviour:
What's not entirely clear to me is:
The example of
I've made a change, and I'll open a CL, but there were tests explicitly asserting the opposite of what this issue says, see:
Also the current comment on the if statement mentions:
Have a look at the changes.