summaryrefslogtreecommitdiff
path: root/Lib/http/client.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-02-03 12:22:11 +0200
committerBerker Peksag <berker.peksag@gmail.com>2015-02-03 12:22:11 +0200
commitfa77458c710e45cd6977814f979612acc5e1457d (patch)
treef82f2949bc0e169848f5625f3dfd28443297ee61 /Lib/http/client.py
parentf7da0e800594b865458252991a2d1139785398c0 (diff)
downloadcpython-fa77458c710e45cd6977814f979612acc5e1457d.tar.gz
Issue #13128: Print response headers for CONNECT requests when debuglevel > 0.
Patch by Demian Brecht.
Diffstat (limited to 'Lib/http/client.py')
-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 392715b24d..a77e501296 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(