mirror of https://github.com/zulip/zulip.git
run-dev: Don’t rewrite the Content-Length header.
A HEAD response has a Content-Length but no body; it’s not correct in that case to let Tornado default Content-Length to 0. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
d425ab5ae5
commit
ead13c11e5
|
@ -302,12 +302,9 @@ class CombineHandler(BaseWebsocketHandler):
|
|||
self._headers = httputil.HTTPHeaders() # clear tornado default header
|
||||
|
||||
for header, v in response.headers.get_all():
|
||||
if header != 'Content-Length':
|
||||
# some header appear multiple times, eg 'Set-Cookie'
|
||||
self.add_header(header, v)
|
||||
# some header appear multiple times, eg 'Set-Cookie'
|
||||
self.add_header(header, v)
|
||||
if response.body:
|
||||
# rewrite Content-Length Header by the response
|
||||
self.set_header('Content-Length', len(response.body))
|
||||
self.write(response.body)
|
||||
self.finish()
|
||||
|
||||
|
|
Loading…
Reference in New Issue