Skip to content
Myr

use geturl to lower scheme

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

authored by daftshady · committed by daftshady · parent 8c8938e · Browse files · 2 files+4 added−8 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+4 added−8 removed

  • other:+4 added−8 removed

2 files+4 added−8 removed

modified:requests/adapters.py+2 added-4 removed
12 unmodified lines
13from .models import Response14from .packages.urllib3.poolmanager import PoolManager, proxy_from_url15from .packages.urllib3.response import HTTPResponse16from .packages.urllib3.util import Timeout as TimeoutSauce17from .compat import urlparse, basestring, urldefrag, unquote, urlunparse17from .compat import urlparse, basestring, urldefrag, unquote18from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers,19 except_on_missing_scheme, get_auth_from_url)20from .structures import CaseInsensitiveDict21from .packages.urllib3.exceptions import MaxRetryError
185 unmodified lines
207 conn = self.proxy_manager[proxy].connection_from_url(url)208 else:209 # Only scheme should be lower case210 parsed = urlparse(url)211 parsed = (parsed.scheme, parsed.netloc, parsed.path,212 parsed.params, parsed.query, parsed.fragment)213 url = urlunparse(parsed)211 url = parsed.geturl()212 conn = self.poolmanager.connection_from_url(url)213214 return conn215
162 unmodified lines
modified:requests/sessions.py+2 added-4 removed
10 unmodified lines
11import os12from collections import Mapping13from datetime import datetime1415from .compat import cookielib, OrderedDict, urljoin, urlparse, urlunparse, builtin_str15from .compat import cookielib, OrderedDict, urljoin, urlparse, builtin_str16from .cookies import cookiejar_from_dict, extract_cookies_to_jar, RequestsCookieJar17from .models import Request, PreparedRequest18from .hooks import default_hooks, dispatch_hook19from .utils import to_key_val_list, default_headers
73 unmodified lines
93 url = '%s:%s' % (parsed_rurl.scheme, url)9495 # The scheme should be lower case...96 parsed = urlparse(url)97 parsed = (parsed.scheme, parsed.netloc, parsed.path,98 parsed.params, parsed.query, parsed.fragment)99 url = urlunparse(parsed)97 url = parsed.geturl()9899 # Facilitate non-RFC2616-compliant 'location' headers100 # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource')101 # Compliant with RFC3986, we percent encode the url.
431 unmodified lines