Skip to content
Myr

Use utility for environment proxy as fallback

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Rohan Jain · committed by Rohan Jain · parent 0ba8c44 · Browse files · 1 file+2 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Rohan Jain <crodjer@gmail.com>

Diff stats

1 file+2 added−5 removed

  • other:+2 added−5 removed

1 file+2 added−5 removed

modified:requests/models.py+2 added-5 removed
26 unmodified lines
27 ConnectionError, HTTPError, RequestException, Timeout, TooManyRedirects,28 URLRequired, SSLError, MissingSchema, InvalidSchema, InvalidURL)29from .utils import (30 get_encoding_from_headers, stream_untransfer, guess_filename, requote_uri,31 stream_decode_response_unicode, get_netrc_auth,31 stream_decode_response_unicode, get_netrc_auth, get_environ_proxies,32 DEFAULT_CA_BUNDLE_PATH)33from .compat import (34 cookielib, urlparse, urlunparse, urljoin, urlsplit, urlencode, str, bytes,35 is_py2)
75 unmodified lines
111112 # If no proxies are given, allow configuration by environment variables113 # HTTP_PROXY and HTTPS_PROXY.114 if not self.proxies and self.config.get('trust_env'):115 if 'HTTP_PROXY' in os.environ:116 self.proxies['http'] = os.environ['HTTP_PROXY']117 if 'HTTPS_PROXY' in os.environ:118 self.proxies['https'] = os.environ['HTTPS_PROXY']115 self.proxies = get_environ_proxies()116117 self.data = data118 self.params = params119 self.files = files
713 unmodified lines