From f3d4480a33b367cf020b0ed447bca10797706094 Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Fri, 28 Aug 2015 20:06:45 +0000 Subject: [PATCH] Use url parsing to check the scheme --- requests/adapters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requests/adapters.py b/requests/adapters.py index 206978b3..96d64327 100644 --- a/requests/adapters.py +++ b/requests/adapters.py @@ -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