Issue 13128: httplib debuglevel on CONNECT doesn't print response headers (original) (raw)

Issue13128

Created on 2011-10-08 05:11 by Matt.Spear, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
httplib.py.patch Matt.Spear,2011-10-08 05:11 Add printing of the headers to CONNECT
issue13128.patch demian.brecht,2014-07-21 23:34 review
issue13128_2.patch demian.brecht,2015-01-07 06:21 review
issue13128_3.patch demian.brecht,2015-01-28 15:25 review
Messages (10)
msg145157 - (view) Author: Matt Spear (Matt.Spear) Date: 2011-10-08 05:11
httplib with a debuglevel prints out the response headers, but does not do so with CONNECT requests (when set_tunnel is used). Attached is a small patch to print the reply when the CONNECT request returns something other than 200 OK. I'm not sure if it is worth printing the headers when a 200 OK is given. If it seems useful I can update the patch. Thanks!!!
msg221913 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-29 22:55
The httplib module has been renamed to http.client in Python 3, besides which the attached patch isn't in the standard format that is used here.
msg223618 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2014-07-21 23:34
Attached a simple fix to the problem as written, matching logging method of HTTPResponse.begin().
msg233563 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-07 06:21
Just happened to come across this now. Updated patch with test.
msg234859 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-27 22:45
Ping.
msg234861 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-01-27 22:58
Thanks for the patch! Could you revert unrelated changes (whitespaces, PEP 8 etc.) if you have time?
msg234862 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-27 23:10
Sure, I should have some time later today to do so. Should such changes not be made as they're encountered in order to clean up the older code that isn't up to spec? Or should they only be made as the code is modified? On 2015-01-27 2:58 PM, Berker Peksag wrote: > > Berker Peksag added the comment: > > Thanks for the patch! Could you revert unrelated changes (whitespaces, PEP 8 etc.) if you have time? > > ---------- > stage: patch review -> commit review > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue13128> > _______________________________________ >
msg234897 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-28 15:25
New patch removes unrelated changes.
msg235333 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-02-03 10:22
New changeset dfbd07cdc031 by Berker Peksag in branch 'default': Issue #13128: Print response headers for CONNECT requests when debuglevel > 0. https://hg.python.org/cpython/rev/dfbd07cdc031
msg235334 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-03 10:25
Thanks for the patch, Demian. I've simplified the test code a bit and committed it. Also, thanks for the report and for the initial patch Matt.
History
Date User Action Args
2022-04-11 14:57:22 admin set github: 57337
2015-02-03 10:25:14 berker.peksag set status: open -> closedresolution: fixedmessages: + stage: commit review -> resolved
2015-02-03 10:22:06 python-dev set nosy: + python-devmessages: +
2015-01-28 15:25:20 demian.brecht set files: + issue13128_3.patchmessages: +
2015-01-27 23:10:44 demian.brecht set messages: +
2015-01-27 22:58:23 berker.peksag set messages: + stage: patch review -> commit review
2015-01-27 22:45:44 demian.brecht set messages: +
2015-01-07 06:21:34 demian.brecht set files: + issue13128_2.patchmessages: +
2014-10-09 05:37:44 berker.peksag set nosy: + berker.peksagversions: + Python 3.5, - Python 3.3
2014-07-21 23:34:02 demian.brecht set files: + issue13128.patchnosy: + demian.brechtmessages: +
2014-06-29 22:55:36 BreamoreBoy set nosy: + BreamoreBoymessages: +
2012-01-05 15:47:39 pitrou set nosy: + orsenthilversions: + Python 3.3, - Python 2.7
2012-01-04 04:39:52 ned.deily set stage: patch review
2011-10-08 05:11:44 Matt.Spear create