aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaT1g3R <peijun.ma@protonmail.com>2019-07-27 08:47:46 -0400
committerAlex Yu <stinky2nine@users.noreply.github.com>2019-07-27 21:47:46 +0900
commit5d9e6492af7557b4fd7f4be1fbfb9f60e27c189d (patch)
tree6c765662f70ebf64b9740a70b8e7fd82c1faa34b
parente92155b85c719405fefe69b045f3bcf55d4fbcc1 (diff)
downloadplatform_external_python_httplib2-5d9e6492af7557b4fd7f4be1fbfb9f60e27c189d.tar.gz
platform_external_python_httplib2-5d9e6492af7557b4fd7f4be1fbfb9f60e27c189d.tar.bz2
platform_external_python_httplib2-5d9e6492af7557b4fd7f4be1fbfb9f60e27c189d.zip
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
-rw-r--r--Makefile2
-rw-r--r--python3/httplib2/__init__.py2
2 files changed, 3 insertions, 1 deletions
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()