We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e3237a commit cdda526Copy full SHA for cdda526
1 file changed
Lib/http/cookiejar.py
@@ -662,7 +662,8 @@ def request_port(request):
662
else:
663
i = request.host.rfind(':')
664
if (i >= 0
665
- and not ']' in request.host[i+1:]): # to prevent IPv6 addresses
+ and not ']' in request.host[i+1:]
666
+ and not request.host.startswith('[')): # to prevent IPv6 addresses
667
_debug("nonnumeric port: '%s'", request.host[i+1:])
668
port = DEFAULT_HTTP_PORT
669
return port
0 commit comments