mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Merged revisions 86450 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86450 | senthil.kumaran | 2010-11-13 20:27:49 +0800 (Sat, 13 Nov 2010) | 3 lines Fix Issue5111 - Wrap the Ipv6 host with [] in the Host header ........
This commit is contained in:
parent
db4c334e0d
commit
501bfd8f5c
3 changed files with 25 additions and 0 deletions
|
@ -879,6 +879,9 @@ class HTTPConnection:
|
|||
host_enc = self.host.encode("ascii")
|
||||
except UnicodeEncodeError:
|
||||
host_enc = self.host.encode("idna")
|
||||
# Wrap the IPv6 Host Header with [] (RFC 2732)
|
||||
if host_enc.find(':') >= 0:
|
||||
host_enc = "[" + host_enc + "]"
|
||||
if self.port == self.default_port:
|
||||
self.putheader('Host', host_enc)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue