Merge pull request #638 from mher/develop

no_proxy support
This commit is contained in:
Kenneth Reitz
2012-05-29 16:44:56 -07:00
+2 -1
View File
@@ -517,9 +517,10 @@ class Request(object):
self.headers['Content-Type'] = content_type
_p = urlparse(url)
no_proxy = filter(lambda x:x.strip(), self.proxies.get('no', '').split(','))
proxy = self.proxies.get(_p.scheme)
if proxy:
if proxy and not any(map(_p.netloc.endswith, no_proxy)):
conn = poolmanager.proxy_from_url(proxy)
_proxy = urlparse(proxy)
if '@' in _proxy.netloc: