Skip to content
Myr

don't lowercase a url before urlparsing it

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

urlparse automatically lowercases the scheme and hostname

authored by Jason Grout · committed by Jason Grout · parent f3d4480 · Browse files · 2 files+2 added−2 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+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:requests/adapters.py+1 added-1 removed
273 unmodified lines
274 :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.275 :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs.276 """277 proxy = select_proxy(request.url, proxies)278 scheme = urlparse(request.url.lower()).scheme278 scheme = urlparse(request.url).scheme279 if proxy and scheme != 'https':280 url = urldefragauth(request.url)281 else:282 url = request.path_url
150 unmodified lines
modified:requests/utils.py+1 added-1 removed
542 unmodified lines
543 :param url: The url being for the request544 :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs545 """546 proxies = proxies or {}547 urlparts = urlparse(url.lower())547 urlparts = urlparse(url)548 proxy = proxies.get(urlparts.scheme+'://'+urlparts.hostname)549 if proxy is None:550 proxy = proxies.get(urlparts.scheme)551 return proxy
169 unmodified lines