bpo-36522: Print all values for headers with multiple values. (GH-12681) (GH-12682)
(cherry picked from commit 461c416dd78a98f2bba7f323af8c9738e060b6f2)
Co-authored-by: Matt Houglum <houglum@google.com>
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 5aa178d..1de151c 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -320,8 +320,8 @@
self.headers = self.msg = parse_headers(self.fp)
if self.debuglevel > 0:
- for hdr in self.headers:
- print("header:", hdr + ":", self.headers.get(hdr))
+ for hdr, val in self.headers.items():
+ print("header:", hdr + ":", val)
# are we using the chunked-style of transfer encoding?
tr_enc = self.headers.get("transfer-encoding")