Skip to content
Myr

Clarify the per-host proxy code

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

authored by Jason Grout · committed by Jason Grout · parent 6185142 · Browse files · 1 file+4 added−2 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+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:requests/adapters.py+4 added-2 removed
237 unmodified lines
238 :param url: The URL to connect to.239 :param proxies: (optional) A Requests-style dictionary of proxies used on this request.240 """241 proxies = proxies or {}242 u = urlparse(url.lower())243 proxy = proxies.get(u.scheme+'://'+u.hostname, proxies.get(u.scheme))242 urlparts = urlparse(url.lower())243 proxy = proxies.get(urlparts.scheme+'://'+urlparts.hostname)244 if proxy is None:245 proxy = proxies.get(urlparts.scheme)246247 if proxy:248 proxy = prepend_scheme_if_needed(proxy, 'http')249 proxy_manager = self.proxy_manager_for(proxy)
188 unmodified lines