bpo-30904: Removed duplicated Host: header. (#4465)

This commit is contained in:
Vinay Sajip 2017-11-19 18:36:17 +00:00 committed by GitHub
parent b56becb373
commit e96ba183c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1180,7 +1180,9 @@ class HTTPHandler(logging.Handler):
i = host.find(":")
if i >= 0:
host = host[:i]
h.putheader("Host", host)
# See issue #30904: putrequest call above already adds this header
# on Python 3.x.
# h.putheader("Host", host)
if self.method == "POST":
h.putheader("Content-type",
"application/x-www-form-urlencoded")