Use url parsing to check the scheme

This commit is contained in:
Jason Grout
2015-08-28 20:06:45 +00:00
parent fb496e4e86
commit f3d4480a33
+2 -1
View File
@@ -275,7 +275,8 @@ class HTTPAdapter(BaseAdapter):
:param proxies: A dictionary of schemes or schemes and hosts to proxy URLs.
"""
proxy = select_proxy(request.url, proxies)
if proxy and not request.url.lower().startswith('https'):
scheme = urlparse(request.url.lower()).scheme
if proxy and scheme != 'https':
url = urldefragauth(request.url)
else:
url = request.path_url