From: Ben Darnell Date: Tue, 22 Feb 2011 21:01:05 +0000 (-0800) Subject: Read a fixed number of bytes for wsgi input, since some wsgi containers X-Git-Tag: v2.0.0~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f4835a34b3e1fcc89c55fc6242f6145bb2d39dd;p=thirdparty%2Ftornado.git Read a fixed number of bytes for wsgi input, since some wsgi containers do not signal EOF. --- diff --git a/tornado/wsgi.py b/tornado/wsgi.py index 90849d450..6bf180f90 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -112,7 +112,8 @@ class HTTPRequest(object): if key.startswith("HTTP_"): self.headers[key[5:].replace("_", "-")] = environ[key] if self.headers.get("Content-Length"): - self.body = environ["wsgi.input"].read() + self.body = environ["wsgi.input"].read( + self.headers["Content-Length"]) else: self.body = "" self.protocol = environ["wsgi.url_scheme"]