Skip to content
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

Improve no_proxy support #94

Closed
cveilleux opened this issue Mar 19, 2018 · 1 comment
Closed

Improve no_proxy support #94

cveilleux opened this issue Mar 19, 2018 · 1 comment

Comments

@cveilleux
Copy link
Contributor

cveilleux commented Mar 19, 2018

Both the py2 and new py3 support for the no_proxy env var use a simple endswith check in bypass_host.

There are no standards about the behaviour of no_proxy env var, but endswith is probably not what you want here.

If domain starts with a dot (example: .example.com):

  • Use endswith to match any subdomain (foo.example.com should match)
  • Remove the dot and do an exact match (example.com should also match)

If domain does not start with a dot (example: example.com):

  • It should be an exact match.

My understanding is that the current implementation of the check will match wrong cases:

no_proxy='bar.com'
bypass_host('foobar.com') # TRUE! 

Might be a good idea to add a test for it.

See this thread: curl/curl#1208

Even the curl people are struggling with understanding / documenting the correct behaviour. There does not seem to be an authoritative document about it.

@cveilleux cveilleux changed the title Improve no_proxy support Improve no_proxy support Mar 19, 2018
temoto added a commit that referenced this issue Mar 19, 2018
temoto added a commit that referenced this issue Mar 20, 2018
@temoto
Copy link
Member

temoto commented Mar 21, 2018

Fix is merged in 12b26f9 and released on PyPI in 0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants