From: Ben Darnell Date: Sun, 8 Sep 2013 01:15:59 +0000 (-0400) Subject: Set Connection: keep-alive header directly without going through set_header. X-Git-Tag: v3.2.0b1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=684fda2b32482f8d6e35e5514ea8e748c378c485;p=thirdparty%2Ftornado.git Set Connection: keep-alive header directly without going through set_header. set_header is not allowed in WebSocketHandler, but some proxies add this header unconditionally. Closes #897. --- diff --git a/tornado/web.py b/tornado/web.py index 5f8d6091b..fe0f2e403 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -250,7 +250,7 @@ class RequestHandler(object): not self.request.connection.no_keep_alive): conn_header = self.request.headers.get("Connection") if conn_header and (conn_header.lower() == "keep-alive"): - self.set_header("Connection", "Keep-Alive") + self._headers["Connection"] = "Keep-Alive" self._write_buffer = [] self._status_code = 200 self._reason = httputil.responses[200]