summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 30fc525..fc908d2 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -772,8 +772,7 @@ class HTTPConnection:
if self.sock:
raise RuntimeError("Can't setup tunnel for established connection.")
- self._tunnel_host = host
- self._tunnel_port = port
+ self._tunnel_host, self._tunnel_port = self._get_hostport(host, port)
if headers:
self._tunnel_headers = headers
else:
@@ -802,8 +801,8 @@ class HTTPConnection:
self.debuglevel = level
def _tunnel(self):
- (host, port) = self._get_hostport(self._tunnel_host, self._tunnel_port)
- self.send("CONNECT %s:%d HTTP/1.0\r\n" % (host, port))
+ self.send("CONNECT %s:%d HTTP/1.0\r\n" % (self._tunnel_host,
+ self._tunnel_port))
for header, value in self._tunnel_headers.iteritems():
self.send("%s: %s\r\n" % (header, value))
self.send("\r\n")