Commit 4d037916 authored by Raymond Hettinger's avatar Raymond Hettinger

SF bug #1046855: httplib index out of range

parent 3079391b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment