]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fixed a bug with keep-alive chunked requests 1125/head
authorTom Arnfeld <tarnfeld@me.com>
Wed, 23 Jul 2014 17:27:03 +0000 (18:27 +0100)
committerTom Arnfeld <tarnfeld@me.com>
Wed, 23 Jul 2014 17:27:03 +0000 (18:27 +0100)
If you make a POST request with 'Connection: Keep-Alive' and use chunked body encoding, tornado will not interpret that as a connection that can be kept alive, and will close the connection.

tornado/http1connection.py

index 72f729d784c28aa9d5ea2dd3de81fd26b84ef849..85efe68ec794bdd912aa46175692f8b3e94bfa33 100644 (file)
@@ -455,6 +455,7 @@ class HTTP1Connection(httputil.HTTPConnection):
         if start_line.version == "HTTP/1.1":
             return connection_header != "close"
         elif ("Content-Length" in headers
+              or headers.get("Transfer-Encoding", "").lower() == "chunked"
               or start_line.method in ("HEAD", "GET")):
             return connection_header == "keep-alive"
         return False