[Python-checkins] bpo-30904: Removed duplicated Host: header. (GH-4465) (#4468)

Vinay Sajip webhook-mailer at python.org
Sun Nov 19 14:16:20 EST 2017


https://github.com/python/cpython/commit/b071a5e838a0e84c4e8a60448fbd40e8a7e5c882
commit: b071a5e838a0e84c4e8a60448fbd40e8a7e5c882
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Vinay Sajip <vinay_sajip at yahoo.co.uk>
date: 2017-11-19T19:16:17Z
summary:

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

(cherry picked from commit e96ba183c43ad6633b5d014b3dc57433e2802faf)

files:
M Lib/logging/handlers.py

diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index daa71abd785..11ebcf124c3 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -1183,7 +1183,9 @@ def emit(self, record):
             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")



More information about the Python-checkins mailing list