From 77e5443f71f29f30c997dc0e6645ee57f40ef4eb Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 9 Mar 2012 07:58:00 -0800 Subject: [PATCH] self.config.get('trust_env') just for @mitsuhiko --- requests/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requests/models.py b/requests/models.py index 795c115..1f85ddf 100644 --- a/requests/models.py +++ b/requests/models.py @@ -104,7 +104,7 @@ class Request(object): # If no proxies are given, allow configuration by environment variables # HTTP_PROXY and HTTPS_PROXY. - if not self.proxies: + if not self.proxies and self.config.get('trust_env'): if 'HTTP_PROXY' in os.environ: self.proxies['http'] = os.environ['HTTP_PROXY'] if 'HTTPS_PROXY' in os.environ: @@ -446,7 +446,7 @@ class Request(object): self.headers['Content-Type'] = content_type # Use .netrc auth if none was provided. - if not self.auth: + if not self.auth and self.config.get('trust_env'): self.auth = get_netrc_auth(url) if self.auth: @@ -487,11 +487,11 @@ class Request(object): cert_loc = self.verify # Look for configuration. - if not cert_loc: + if not cert_loc and self.config.get('trust_env'): cert_loc = os.environ.get('REQUESTS_CA_BUNDLE') # Curl compatiblity. - if not cert_loc: + if not cert_loc and self.config.get('trust_env'): cert_loc = os.environ.get('CURL_CA_BUNDLE') # Use the awesome certifi list. -- 2.34.1