SF bug #1046855: httplib index out of range

This commit is contained in:
Raymond Hettinger 2004-10-14 15:23:38 +00:00
parent 3079391b8d
commit 4d03791632
1 changed files with 1 additions and 1 deletions

View File

@ -593,7 +593,7 @@ class HTTPConnection:
host = host[:i]
else:
port = self.default_port
if host[0] == '[' and host[-1] == ']':
if host and host[0] == '[' and host[-1] == ']':
host = host[1:-1]
self.host = host
self.port = port