Skip to content
Myr

Fixed another scheme proxy over "all" priority

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

authored by Michael Hunsinger · committed by Michael Hunsinger · parent 3314259 · Browse files · 3 files+3 added−3 removed
This commit

State

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

Diff stats

3 files+3 added−3 removed

  • tests:+1 added−1 removed
  • other:+2 added−2 removed

3 files+3 added−3 removed

modified:requests/sessions.py+1 added-1 removed
224 unmodified lines
225226 if self.trust_env and not should_bypass_proxies(url):227 environ_proxies = get_environ_proxies(url)228229 proxy = environ_proxies.get('all', environ_proxies.get(scheme))229 proxy = environ_proxies.get(scheme, environ_proxies.get('all'))230231 if proxy:232 new_proxies.setdefault(scheme, proxy)233
479 unmodified lines
modified:requests/utils.py+1 added-1 removed
615 unmodified lines
616 """617 proxies = proxies or {}618 urlparts = urlparse(url)619 if urlparts.hostname is None:620 return proxies.get('all', proxies.get(urlparts.scheme))620 return proxies.get(urlparts.scheme, proxies.get('all'))621622 proxy_keys = [623 urlparts.scheme + '://' + urlparts.hostname,624 urlparts.scheme,
193 unmodified lines
modified:tests/test_utils.py+1 added-1 removed
341 unmodified lines
342 ('http://u:p@other.host/path', 'http://http.proxy', mixed_proxies),343 ('http://u:p@some.host/path', 'http://some.host.proxy', mixed_proxies),344 ('https://u:p@other.host/path', 'socks5://http.proxy', mixed_proxies),345 ('https://u:p@some.host/path', 'socks5://http.proxy', mixed_proxies),346 346 ('https://', 'socks5://http.proxy', mixed_proxies),347 # XXX: unsure whether this is reasonable behavior348 ('file:///etc/motd', 'socks5://http.proxy', all_proxies),349 ))350def test_select_proxies(url, expected, proxies):
125 unmodified lines