Merge pull request #2721 from Lukasa/no_proxy_fix

Ignore empty fields in no_proxy env var
This commit is contained in:
Cory Benfield
2015-10-05 15:28:49 +01:00
+3 -1
View File
@@ -499,7 +499,9 @@ def should_bypass_proxies(url):
if no_proxy:
# We need to check whether we match here. We need to see if we match
# the end of the netloc, both with and without the port.
no_proxy = no_proxy.replace(' ', '').split(',')
no_proxy = (
host for host in no_proxy.replace(' ', '').split(',') if host
)
ip = netloc.split(':')[0]
if is_ipv4_address(ip):