Don't get hung up on ports in proxies.
authorCory Benfield <lukasaoz@gmail.com>
Wed, 15 Aug 2012 17:16:27 +0000 (18:16 +0100)
committerCory Benfield <lukasaoz@gmail.com>
Wed, 15 Aug 2012 17:16:27 +0000 (18:16 +0100)
requests/models.py

index ae3c1be..b45e99c 100644 (file)
@@ -556,7 +556,7 @@ class Request(object):
         no_proxy = filter(lambda x:x.strip(), self.proxies.get('no', '').split(','))
         proxy = self.proxies.get(_p.scheme)
 
-        if proxy and not any(map(_p.netloc.endswith, no_proxy)):
+        if proxy and not any(map(_p.hostname.endswith, no_proxy)):
             conn = poolmanager.proxy_from_url(proxy)
             _proxy = urlparse(proxy)
             if '@' in _proxy.netloc: