]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Read a fixed number of bytes for wsgi input, since some wsgi containers
authorBen Darnell <ben@bendarnell.com>
Tue, 22 Feb 2011 21:01:05 +0000 (13:01 -0800)
committerBen Darnell <ben@bendarnell.com>
Tue, 22 Feb 2011 21:01:05 +0000 (13:01 -0800)
do not signal EOF.

tornado/wsgi.py

index 90849d4509e04a9ff84d710ec3b766dfda2b77d5..6bf180f90dffbdbe4b5660128d1f90158a840223 100644 (file)
@@ -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"]