From 00b4ca3b744fa25d3c4aabf49774eaa40caf9f33 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 15 Aug 2012 18:16:27 +0100 Subject: [PATCH] Don't get hung up on ports in proxies. --- requests/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index ae3c1be1..b45e99cd 100644 --- a/requests/models.py +++ b/requests/models.py @@ -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: