Commit a93b3775 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

patch: Delete the 'Content-Length' header when the status code equals 304

parent 479d57d1
...@@ -26,6 +26,11 @@ def finalize(self): ...@@ -26,6 +26,11 @@ def finalize(self):
headers = self.headers headers = self.headers
body = self.body body = self.body
# There's a bug in 'App.ImageFile.index_html': when it returns a 304 status
# code, 'Content-Length' is equal to a nonzero value.
if self.status == 304:
headers.pop('content-length', None)
# set 204 (no content) status if 200 and response is empty # set 204 (no content) status if 200 and response is empty
# and not streaming # and not streaming
if ('content-type' not in headers and if ('content-type' not in headers and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment