mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #3839: wsgiref should not override a Content-Length header set by
the application. Initial patch by Clovis Fabricio.
This commit is contained in:
parent
f1397ad399
commit
b715fac819
4 changed files with 18 additions and 5 deletions
|
@ -302,7 +302,9 @@ class BaseHandler:
|
|||
def finish_content(self):
|
||||
"""Ensure headers and content have both been sent"""
|
||||
if not self.headers_sent:
|
||||
self.headers['Content-Length'] = "0"
|
||||
# Only zero Content-Length if not set by the application (so
|
||||
# that HEAD requests can be satisfied properly, see #3839)
|
||||
self.headers.setdefault('Content-Length', "0")
|
||||
self.send_headers()
|
||||
else:
|
||||
pass # XXX check if content-length was too short?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue