-
Notifications
You must be signed in to change notification settings - Fork 197
Fix some chars (!, =, etc) being treated as not allowed in userinfo of authority #331
Fix some chars (!, =, etc) being treated as not allowed in userinfo of authority #331
Conversation
…ed as per RFC3986
As per https://tools.ietf.org/html/rfc3986#section-3.2.1 userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) Where, according to https://tools.ietf.org/html/rfc3986#section-2.2 , sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" The sub-delims set of chars was added in this commit
|
How come first Travis build haven't failed? 😄 Maybe because I've pushed a fix too fast. That test fails for me locally: It happens because userinfo part in this test contains |
|
Thanks for this! However, RFC3986 is a third-party library, not part of this code, so we'd need to fix it in that repo. Sorry! |
|
Oh, right, I guess it's this one: https://github.com/sigmavirus24/rfc3986 BTW, what do you think about issuing a warning when stripping out the userinfo part? |
|
That's the one. 😀 As to the warning, I'm not sure. Try pushing a branch that does it and I'll see what it looks like. |
|
This PR has been merged in python-hyper/rfc3986#26 What are the following steps? Should I make a PR updating the vendored library? |
|
I'm open to going either direction. The easiest thing to do, probably, is ask for a PyPI release and then unvendor. |
|
Great, let's go with unvendoring then. I'll open a PR after PyPI release |
As per https://tools.ietf.org/html/rfc3986#section-3.2.1
Where, according to https://tools.ietf.org/html/rfc3986#section-2.2 ,
The
sub-delimsset of chars was added in this PR.--
(a bit unrelated)
Hyper doesn't handle userinfo to automatically add Basic Auth header to requests. If
host(orproxy_host) of connection contains userinfo, it's getting stripped out in the to_host_port_tuple function.I feel it's not good to quietly eat up auth part without actually using it. Maybe at least we should issue a warning in this case?