Skip to content
Myr

Merge pull request #1636 from Lukasa/httpsprox

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Don't send the full URL on CONNECT messages.

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 318ca10, 8b7fcfb · Browse files · 1 file+5 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:requests/adapters.py+5 added-4 removed
219 unmodified lines
220221 def request_url(self, request, proxies):222 """Obtain the url to use when making the final request.223224 If the message is being sent through a proxy, the full URL has to be225 used. Otherwise, we should only use the path portion of the URL.224 If the message is being sent through a HTTP proxy, the full URL has to225 be used. Otherwise, we should only use the path portion of the URL.226227 This should not be called from user code, and is only exposed for use228 when subclassing the229 :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
1 unmodified line
231 :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.232 :param proxies: A dictionary of schemes to proxy URLs.233 """234 proxies = proxies or {}235 scheme = urlparse(request.url).scheme.lower()235 proxy = proxies.get(urlparse(request.url).scheme)236 proxy = proxies.get(scheme)237237 if proxy:238 if proxy and scheme != 'https':239 url, _ = urldefrag(request.url)240 else:241 url = request.path_url242
132 unmodified lines