Merge pull request #5894 from dbaxa/do-not-re-build-proxies-when-proxies-have-been-provided

Prevent unnecessary should_bypass_proxies checks in rebuild_proxies
This commit is contained in:
Nate Prewitt
2021-12-29 10:06:05 -07:00
committed by GitHub
+1 -2
View File
@@ -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'))