Skip to content
Myr

Merge pull request #1747 from daftshady/lowercase

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

#1746 don't lowercase the whole url

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 8a4c830, 4972133 · Browse files · 2 files+7 added−6 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+7 added−6 removed

  • other:+7 added−6 removed

2 files+7 added−6 removed

modified:requests/adapters.py+5 added-2 removed
204 unmodified lines
205 proxy_headers=proxy_headers)206207 conn = self.proxy_manager[proxy].connection_from_url(url)208 else:209 # Only scheme should be lower case210 parsed = urlparse(url)211 url = parsed.geturl()209 conn = self.poolmanager.connection_from_url(url.lower())212 conn = self.poolmanager.connection_from_url(url)213214 return conn215216 def close(self):
17 unmodified lines
234 :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.235 :param proxies: A dictionary of schemes to proxy URLs.236 """237 proxies = proxies or {}235 scheme = urlparse(request.url).scheme.lower()238 scheme = urlparse(request.url).scheme239 proxy = proxies.get(scheme)240241 if proxy and scheme != 'https':242 url, _ = urldefrag(request.url)
135 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.lower(), 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