From ab53ab0a843757d2a40bde1e00a80ea91bcf8402 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Tue, 3 Feb 2015 12:22:11 +0200 Subject: Issue #13128: Print response headers for CONNECT requests when debuglevel > 0. Patch by Demian Brecht. --- Lib/http/client.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Lib/http/client.py') 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( -- cgit v1.2.1