diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2015-02-03 10:22:11 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2015-02-03 10:22:11 (GMT) |
commit | ab53ab0a843757d2a40bde1e00a80ea91bcf8402 (patch) | |
tree | e1d75ac172868df83964bd558cccca4d5ea6e186 /Lib/http | |
parent | 50457403f2a86769f378b6a57f6f4ed0c7b9cc39 (diff) | |
download | cpython-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.py | 3 |
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( |