summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-09-14 21:45:36 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-09-14 21:45:36 (GMT)
commit74a249e1a9424c6055435a855916a580d443189f (patch)
tree3c6066441df31db119f8cadb0f574f0c570a6692 /Lib/httplib.py
parent82d0eecf427ca09f65cfa9a718adfd9e5e7275e8 (diff)
downloadcpython-74a249e1a9424c6055435a855916a580d443189f.zip
cpython-74a249e1a9424c6055435a855916a580d443189f.tar.gz
cpython-74a249e1a9424c6055435a855916a580d443189f.tar.bz2
Strip square brackets from IPv6 address.
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index b7276af..c88b172 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -534,6 +534,8 @@ class HTTPConnection:
host = host[:i]
else:
port = self.default_port
+ if host[0] == '[' and host[-1] == ']':
+ host = host[1:-1]
self.host = host
self.port = port