mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
responses 1xx, 204 and 304 should not force the connection to be closed
Only these types of responses are allowed to have empty body fix #581
This commit is contained in:
parent
fa9d028d09
commit
9f4cf4181f
@ -194,6 +194,9 @@ class Response(object):
|
|||||||
return True
|
return True
|
||||||
if self.response_length is not None or self.chunked:
|
if self.response_length is not None or self.chunked:
|
||||||
return False
|
return False
|
||||||
|
status = self.status.split()[0] if self.status else ''
|
||||||
|
if status.startswith('1') or status in ('204', '304'):
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def start_response(self, status, headers, exc_info=None):
|
def start_response(self, status, headers, exc_info=None):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user