mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
missed the obvious test case and corresponding fix
This commit is contained in:
parent
1fd00a1b71
commit
cae14d2714
2 changed files with 3 additions and 2 deletions
|
@ -525,7 +525,8 @@ class HTTPConnection:
|
|||
def _set_hostport(self, host, port):
|
||||
if port is None:
|
||||
i = host.rfind(':')
|
||||
if i >= 0:
|
||||
j = host.rfind(']') # ipv6 addresses have [...]
|
||||
if i > j:
|
||||
try:
|
||||
port = int(host[i+1:])
|
||||
except ValueError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue