mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merged fix for #10860 from 3.2
This commit is contained in:
commit
6c4e1aed4b
2 changed files with 26 additions and 3 deletions
|
@ -678,7 +678,10 @@ class HTTPConnection:
|
|||
try:
|
||||
port = int(host[i+1:])
|
||||
except ValueError:
|
||||
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
|
||||
if host[i+1:] == "": # http://foo.com:/ == http://foo.com/
|
||||
port = self.default_port
|
||||
else:
|
||||
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
|
||||
host = host[:i]
|
||||
else:
|
||||
port = self.default_port
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue