[New-bugs-announce] [issue3839] wsgi.simple_server resets 'Content-Length' header on empty content even if app defined it.

Clovis Fabricio report at bugs.python.org
Thu Sep 11 20:08:34 CEST 2008


New submission from Clovis Fabricio <nosklo+python at gmail.com>:

The finish_content method in wsgiref.handlers.BaseHandler class resets
Content-Length to "0" if there was no content returned by the
application, even if the application has set it already.

That makes impossible to implement things like HEAD requests in the
application, which should return the Content-Length without returning
actual content.

The desired behavior would be to respect the header set by the wsgi
application, using "0" as a default value instead.

----------
components: Library (Lib)
files: wsgiref.handlers.py.patch
keywords: patch
messages: 73045
nosy: nosklo
severity: normal
status: open
title: wsgi.simple_server resets 'Content-Length' header on empty content even if app defined it.
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file11466/wsgiref.handlers.py.patch

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


More information about the New-bugs-announce mailing list