[issue13294] http.server: HEAD request should not return a body

Éric Araujo report at bugs.python.org
Fri Nov 18 11:23:55 CET 2011


Éric Araujo <merwok at netwok.org> added the comment:

Hi Michele, long time no see :)

> Well, actually SimpleHTTPRequesthandler extends BaseHTTPHandler with basic do_GET and
> do_HEAD methods.
> Unittests for http.server shows that this behavior is intended, since: [snip] 
Not sure what this test shows (maybe because I need coffee :)

> Anyway, I would propose a trivial patch to make http.server a little more elegant.
The first change may do more that you want it to: rstrip without argument will remove all whitespace, but there the code wants to remove only CRLF or LF.  Anyway, changes for the sake of elegance or cleanliness are not done for the sake of it, but usually as a part of a greater refactoring or fix.  We prefer to minimize chances of compatibility breakage by avoiding gratuitous changes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13294>
_______________________________________


More information about the Python-bugs-list mailing list