Skip to content

Commit

Permalink
Only compute should_bypass_proxies if needed
Browse files Browse the repository at this point in the history
Co-authored-by: David Black <dblack@atlassian.com>
  • Loading branch information
nateprewitt and dbaxa committed Dec 29, 2021
1 parent d096599 commit 0d5347e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions requests/utils.py
Expand Up @@ -850,8 +850,7 @@ def resolve_proxies(request, proxies, trust_env=True):
no_proxy = proxies.get('no_proxy')
new_proxies = proxies.copy()

bypass_proxy = should_bypass_proxies(url, no_proxy=no_proxy)
if trust_env and not bypass_proxy:
if trust_env and not should_bypass_proxies(url, no_proxy=no_proxy):
environ_proxies = get_environ_proxies(url, no_proxy=no_proxy)

proxy = environ_proxies.get(scheme, environ_proxies.get('all'))
Expand Down

0 comments on commit 0d5347e

Please sign in to comment.