Don't parse nonexistent URLs.

This commit is contained in:
Cory Benfield
2015-12-30 10:48:29 +00:00
parent 39ee5d46dc
commit 1c54014daf
+2 -1
View File
@@ -302,7 +302,8 @@ class HTTPAdapter(BaseAdapter):
"""
proxy = select_proxy(request.url, proxies)
scheme = urlparse(request.url).scheme
proxy_scheme = urlparse(proxy).scheme
if proxy:
proxy_scheme = urlparse(proxy).scheme
if proxy and proxy_scheme.lower().startswith('socks'):
# Socks proxies behave like the proxy isn't there at all.