run-dev: Discard Transfer-Encoding header from upstream response.

When the upstream provides a chunked response, proxying this header
causes a protocol-level miscommunication.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-09-10 13:17:04 -07:00 committed by Tim Abbott
parent d840d80ed4
commit 2fe1ece3a6
1 changed files with 2 additions and 1 deletions

View File

@ -261,7 +261,8 @@ class BaseHandler(web.RequestHandler):
for header, v in response.headers.get_all():
# some header appear multiple times, eg 'Set-Cookie'
self.add_header(header, v)
if header.lower() != "transfer-encoding":
self.add_header(header, v)
if response.body:
self.write(response.body)
self.finish()