Skip to content

Commit

Permalink
Merge pull request #5894 from dbaxa/do-not-re-build-proxies-when-prox…
Browse files Browse the repository at this point in the history
…ies-have-been-provided

Prevent unnecessary should_bypass_proxies checks in rebuild_proxies
  • Loading branch information
nateprewitt authored Dec 29, 2021
2 parents b0829a8 + 0d5347e commit 77d1e9a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions requests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,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 77d1e9a

Please sign in to comment.