Merge pull request #779 from Lukasa/develop
authorKenneth Reitz <me@kennethreitz.com>
Sun, 19 Aug 2012 00:40:53 +0000 (17:40 -0700)
committerKenneth Reitz <me@kennethreitz.com>
Sun, 19 Aug 2012 00:40:53 +0000 (17:40 -0700)
Make sure proxy exclusions work properly.

1  2 
requests/models.py

@@@ -533,10 -553,10 +533,10 @@@ class Request(object)
              self.__dict__.update(r.__dict__)
  
          _p = urlparse(url)
 -        no_proxy = filter(lambda x:x.strip(), self.proxies.get('no', '').split(','))
 +        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: