From: Cory Benfield Date: Sat, 28 Sep 2013 14:46:43 +0000 (+0100) Subject: Don't send the full URL on CONNECT messages. X-Git-Tag: v2.0.1~13^2~7^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b7fcfb49a38cd6ee1cbb4a52e0a4af57969abb3;p=services%2Fpython-requests.git Don't send the full URL on CONNECT messages. --- diff --git a/requests/adapters.py b/requests/adapters.py index d557b74..5799523 100644 --- a/requests/adapters.py +++ b/requests/adapters.py @@ -220,8 +220,8 @@ class HTTPAdapter(BaseAdapter): def request_url(self, request, proxies): """Obtain the url to use when making the final request. - If the message is being sent through a proxy, the full URL has to be - used. Otherwise, we should only use the path portion of the URL. + If the message is being sent through a HTTP proxy, the full URL has to + be used. Otherwise, we should only use the path portion of the URL. This should not be called from user code, and is only exposed for use when subclassing the @@ -231,9 +231,10 @@ class HTTPAdapter(BaseAdapter): :param proxies: A dictionary of schemes to proxy URLs. """ proxies = proxies or {} - proxy = proxies.get(urlparse(request.url).scheme) + scheme = urlparse(request.url).scheme.lower() + proxy = proxies.get(scheme) - if proxy: + if proxy and scheme != 'https': url, _ = urldefrag(request.url) else: url = request.path_url