don't lowercase a url before urlparsing it

urlparse automatically lowercases the scheme and hostname
This commit is contained in:
Jason Grout
2015-08-28 20:20:07 +00:00
parent f3d4480a33
commit 4c6540898c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ class HTTPAdapter(BaseAdapter):
:param proxies: A dictionary of schemes or schemes and hosts to proxy URLs.
"""
proxy = select_proxy(request.url, proxies)
scheme = urlparse(request.url.lower()).scheme
scheme = urlparse(request.url).scheme
if proxy and scheme != 'https':
url = urldefragauth(request.url)
else:
+1 -1
View File
@@ -544,7 +544,7 @@ def select_proxy(url, proxies):
:param proxies: A dictionary of schemes or schemes and hosts to proxy URLs
"""
proxies = proxies or {}
urlparts = urlparse(url.lower())
urlparts = urlparse(url)
proxy = proxies.get(urlparts.scheme+'://'+urlparts.hostname)
if proxy is None:
proxy = proxies.get(urlparts.scheme)