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

(cherry picked from commit e96ba183c4)
This commit is contained in:
Miss Islington (bot) 2017-11-19 11:16:17 -08:00 committed by Vinay Sajip
parent 65dffe58dd
commit b071a5e838

View file

@ -1183,7 +1183,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")