From: Ben Darnell Date: Tue, 25 Oct 2011 17:50:22 +0000 (-0700) Subject: Add return statements missing from HEAD/204 fix X-Git-Tag: v2.2.0~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=326523bebae53c068c80d6b5f3a84db937820a75;p=thirdparty%2Ftornado.git Add return statements missing from HEAD/204 fix --- diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index 65a241f5c..15773bb3b 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -329,12 +329,14 @@ class _HTTPConnection(object): # HEAD requests never have content, even though they may have # content-length headers self._on_body(b("")) + return if 100 <= self.code < 200 or self.code in (204, 304): # These response codes never have bodies # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3 assert "Transfer-Encoding" not in self.headers assert content_length in (None, 0) self._on_body(b("")) + return if (self.request.use_gzip and self.headers.get("Content-Encoding") == "gzip"):