From: Tom Arnfeld Date: Wed, 23 Jul 2014 17:27:03 +0000 (+0100) Subject: Fixed a bug with keep-alive chunked requests X-Git-Tag: v4.1.0b1~126^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=404ec8bd038808f9b4da64d71eb16242aa701563;p=thirdparty%2Ftornado.git Fixed a bug with keep-alive chunked requests 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. --- diff --git a/tornado/http1connection.py b/tornado/http1connection.py index 72f729d78..85efe68ec 100644 --- a/tornado/http1connection.py +++ b/tornado/http1connection.py @@ -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