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
urllib: no_proxy variable values with leading dot not properly handled #73328
Comments
Hi, the fix for bpo-26864 changed the behavior of urllib for no_proxy values with a leading dot to no longer match anything. This seems to be caused by always adding an additional dot between the hostname being checked and the entry. Example: I would expect 'somehost.company.internal' to be accessed without proxy, but this is not actually the case. Changing no_proxy to company.internal changes this and the host is accessed without proxy. Python 2.7.11 and curl both handle this case fine and the proxy is not used. Regards, |
I added a line stripping dots from name, I think it makes sense to strip at the end as well ( |
Note: We don't officially use pull requests yet. Current way of contributing to Python is documented at https://docs.python.org/devguide/patch.html |
Too bad, I was all exited when I saw that I can paste a PR link here :) I downloaded the patch from the commit using github, I hope that works? |
Yes, thanks! |
Are your sure the host checked against the list is FQDN? With and without the trailing dot are different. |
Thanks for the feedback! I changed the patch to use lstrip so that the FQDN "example.com." would match the NOPROXY entry "example.com.". I don't think we get FQDNs, but that's just my guess. I think ideally "example.com" would also match "example.com." but that's a different issue. |
LGTM. |
New changeset cb4f73be9486 by Xiang Zhang in branch '2.7': New changeset 350c5a1f9cfd by Xiang Zhang in branch '3.5': New changeset e90efd9f203e by Xiang Zhang in branch '3.6': New changeset 3954f8f6be3d by Xiang Zhang in branch 'default': |
Thanks Milan and Thomas! |
Misc/NEWS
so that it is managed by towncrier #552Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: