mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
When the response is a 304 turn off chunked responses as there is a guarantee there is no response body (hence no Content-Length defined)
This can cause odd behavior with browsers not being able to parse the response correctly (not sure if this is just a property of empty chunked responses or something else)
This commit is contained in:
parent
5aabdc0ae2
commit
6dc33b1ca4
@ -208,6 +208,10 @@ class Response(object):
|
||||
return False
|
||||
elif self.req.version <= (1,0):
|
||||
return False
|
||||
elif self.status.startswith("304"):
|
||||
# Do not use chunked responses when the response is guaranteed to
|
||||
# not have a response body.
|
||||
return False
|
||||
return True
|
||||
|
||||
def default_headers(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user