Skip to content

Commit

Permalink
When rebuilding proxies if we do not trust the environment then we do…
Browse files Browse the repository at this point in the history
… not need to examine proxy information set in the environ.

This fixes a performance regression 5891 but does not fix 5888.

Signed-off-by: David Black <dblack@atlassian.com>
  • Loading branch information
dbaxa committed Jul 29, 2021
1 parent cf2e3fd commit 7cc5e5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion requests/sessions.py
Expand Up @@ -289,7 +289,9 @@ def rebuild_proxies(self, prepared_request, proxies):
new_proxies = proxies.copy()
no_proxy = proxies.get('no_proxy')

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

Expand Down

0 comments on commit 7cc5e5c

Please sign in to comment.