]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Set Connection: keep-alive header directly without going through set_header.
authorBen Darnell <ben@bendarnell.com>
Sun, 8 Sep 2013 01:15:59 +0000 (21:15 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 8 Sep 2013 01:15:59 +0000 (21:15 -0400)
set_header is not allowed in WebSocketHandler, but some proxies add
this header unconditionally.

Closes #897.

tornado/web.py

index 5f8d6091b7a0c855016c18ed80a1d0ada370ed07..fe0f2e4038c759c79d10b679413723e1a5780513 100644 (file)
@@ -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]