summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-02-03 10:22:11 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-02-03 10:22:11 (GMT)
commitab53ab0a843757d2a40bde1e00a80ea91bcf8402 (patch)
treee1d75ac172868df83964bd558cccca4d5ea6e186 /Lib/http
parent50457403f2a86769f378b6a57f6f4ed0c7b9cc39 (diff)
downloadcpython-ab53ab0a843757d2a40bde1e00a80ea91bcf8402.zip
cpython-ab53ab0a843757d2a40bde1e00a80ea91bcf8402.tar.gz
cpython-ab53ab0a843757d2a40bde1e00a80ea91bcf8402.tar.bz2
Issue #13128: Print response headers for CONNECT requests when debuglevel > 0.
Patch by Demian Brecht.
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/client.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 392715b..a77e501 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -776,6 +776,9 @@ class HTTPConnection:
if line in (b'\r\n', b'\n', b''):
break
+ if self.debuglevel > 0:
+ print('header:', line.decode())
+
def connect(self):
"""Connect to the host and port specified in __init__."""
self.sock = self._create_connection(