Strip square brackets from IPv6 address.

This commit is contained in:
Martin v. Löwis 2004-09-14 21:45:36 +00:00
parent 82d0eecf42
commit 74a249e1a9
2 changed files with 10 additions and 3 deletions

View file

@ -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