From 5d9e6492af7557b4fd7f4be1fbfb9f60e27c189d Mon Sep 17 00:00:00 2001 From: MaT1g3R Date: Sat, 27 Jul 2019 08:47:46 -0400 Subject: Python3: Use no_proxy (#140) * Py3: Skip proxy if it's bypassed by no_proxy The Python2 version of HTTP.request calls self._get_proxy_info, which calls proxy_info.applies_to * Make `make tests` work --- Makefile | 2 ++ python3/httplib2/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 96fabaa..3ec958a 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +.PHONY: tests + tests: -cd python2 && python2.4 httplib2test.py -cd python2 && python2.5 httplib2test.py diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py index fee8de9..7257585 100644 --- a/python3/httplib2/__init__.py +++ b/python3/httplib2/__init__.py @@ -1136,7 +1136,7 @@ class HTTPConnectionWithTimeout(http.client.HTTPConnection): raise ProxiesUnavailableError( "Proxy support missing but proxy use was requested!" ) - if self.proxy_info and self.proxy_info.isgood(): + if self.proxy_info and self.proxy_info.isgood() and self.proxy_info.applies_to(self.host): use_proxy = True proxy_type, proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass, proxy_headers = ( self.proxy_info.astuple() -- cgit v1.2.3