-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
no_proxy
setting ignores the proxies
dictionary
#5000
Comments
Please fix the issue as it causes a slightly bigger issue - the session.send() method is ignoring the os.environ proxy settings so there is not way to specify proxy settings other than passing proxies explicitly, which doesn't bypass and ignores no_proxy. |
A possible hint looking at the logic for "should we bypass proxies" in Requests, is that this logic is only checked on redirects… Line 292 in 1b41763
When I would expect it to also be called on each request to decide "should we use proxies for this URL". Eg in Lines 718 to 730 in 1b41763
But I'm not 100% sure at which layer the proxies vs connection pool decision occur, eg if it's in the default For what it's worth, the 2nd failing test case works as expected with HTTPX: >>> import os, httpx
>>> os.environ['no_proxy'] = 'google.com'
>>> proxies = {'https': 'https://no.where.com'}
>>> c = httpx.Client(proxies=proxies)
>>> c.get('https://google.com')
<Response [200 OK]> The 1st failing test case doesn't though, because |
These work:
These do not work:
System Information
cc @Lukasa @sigmavirus24
The text was updated successfully, but these errors were encountered: