Skip to content
Myr

Merge pull request #2249 from t-8ch/fix_2247

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

fix #2247

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 779c001, cd5eb62 · Browse files · 2 files+18 added−3 removed
This commit

State

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

Diff stats

2 files+18 added−3 removed

  • other:+18 added−3 removed

2 files+18 added−3 removed

modified:requests/adapters.py+3 added-3 removed
13 unmodified lines
14from .packages.urllib3 import Retry15from .packages.urllib3.poolmanager import PoolManager, proxy_from_url16from .packages.urllib3.response import HTTPResponse17from .packages.urllib3.util import Timeout as TimeoutSauce18from .compat import urlparse, basestring, urldefrag18from .compat import urlparse, basestring19from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers,20 prepend_scheme_if_needed, get_auth_from_url)20 prepend_scheme_if_needed, get_auth_from_url, urldefragauth)21from .structures import CaseInsensitiveDict22from .packages.urllib3.exceptions import ConnectTimeoutError23from .packages.urllib3.exceptions import HTTPError as _HTTPError24from .packages.urllib3.exceptions import MaxRetryError
244 unmodified lines
269 scheme = urlparse(request.url).scheme270 proxy = proxies.get(scheme)271272 if proxy and scheme != 'https':273 url, _ = urldefrag(request.url)273 url = urldefragauth(request.url)274 else:275 url = request.path_url276277 return url
149 unmodified lines
modified:requests/utils.py+15 added
667 unmodified lines
668 else:669 out = string.decode(encoding)670671 return out672673674def urldefragauth(url):675 """676 Given a url remove the fragment and the authentication part677 """678 scheme, netloc, path, params, query, fragment = urlparse(url)679680 # see func:`prepend_scheme_if_needed`681 if not netloc:682 netloc, path = path, netloc683684 netloc = netloc.rsplit('@', 1)[-1]685686 return urlunparse((scheme, netloc, path, params, query, ''))