mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
Search from the end of the host/port combination to find the colon which
separates ip address from the port to accommodate ipv6 addresses.
This commit is contained in:
parent
065a32f550
commit
10e6e0e61a
2 changed files with 8 additions and 1 deletions
|
@ -524,7 +524,7 @@ class HTTPConnection:
|
|||
|
||||
def _set_hostport(self, host, port):
|
||||
if port is None:
|
||||
i = host.find(':')
|
||||
i = host.rfind(':')
|
||||
if i >= 0:
|
||||
try:
|
||||
port = int(host[i+1:])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue