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
Incorrect RFC 3986 validation? #1640
Comments
So according to the RFC the From RFC 3986 Appendix A:
So that URI is technically not RFC 3986 compliant. However I wonder if we can loosen that restriction as we simply strip off userinfo and |
I also ran into this issue trying to use a proxy that requires As an aside, I'll also note that once I got past this issue, I ran into |
@ZedNaught It get unescaped on the proxy side, they probably handle changing percent-encoded bytes back into ASCII before validating your username+password. I'd love to hear more about the IPv6+PySocks incompatibility, could you open a separate issue and provide more detail about the environment it is working with and the one it isn't working with? |
Closed via #1647 |
As of release 1.25, I believe certain RFC 3986 compliant URIs have been wrongly marked as invalid, leading to
urllib3.exceptions.LocationParseError: Failed to parse
exceptions.I'm thinking that this is caused by the appearance of an @ (at) symbol in the
userinfo
portion of the URI, which previously went ignored.To reproduce:
Unfortunately I'm not all that good at reading RFC documents, so I'm not sure if the @ (at) symbol appearing is in violation of the standard or not. To gather more evidence, I tried using uritools - another Python package advertising RFC 3986 compliance - to see what it thinks of that URI. It agrees that it is compliant.
I'll leave it to better minds to judge if this is the intended behavior.
Some loosely related background:
My vpn provider provides SOCKS5 proxies to their customers which I use with Python
requests
in my own scripts, as an easy way to proxy HTTP traffic. Pythonrequests
requires that socks5 proxies are specified assocks5://username:password@vpn.example.com:1080
, and in this case, theusername
was an email address.Since upgrading urllib3, my scripts have been throwing
LocationParseError
when one of these proxy URIs is specified.The text was updated successfully, but these errors were encountered: