]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Convert WSGI content-length variable to an int at the right place
authorBen Darnell <ben@bendarnell.com>
Sat, 16 Apr 2011 20:26:03 +0000 (13:26 -0700)
committerBen Darnell <ben@bendarnell.com>
Sat, 16 Apr 2011 20:26:03 +0000 (13:26 -0700)
Closes #245

tornado/wsgi.py

index 6bf180f90dffbdbe4b5660128d1f90158a840223..7c261ffe4e9c61d5551dbf9f15e76bae4b7bb4a5 100644 (file)
@@ -107,13 +107,13 @@ class HTTPRequest(object):
         if environ.get("CONTENT_TYPE"):
             self.headers["Content-Type"] = environ["CONTENT_TYPE"]
         if environ.get("CONTENT_LENGTH"):
-            self.headers["Content-Length"] = int(environ["CONTENT_LENGTH"])
+            self.headers["Content-Length"] = environ["CONTENT_LENGTH"]
         for key in environ:
             if key.startswith("HTTP_"):
                 self.headers[key[5:].replace("_", "-")] = environ[key]
         if self.headers.get("Content-Length"):
             self.body = environ["wsgi.input"].read(
-                self.headers["Content-Length"])
+                int(self.headers["Content-Length"]))
         else:
             self.body = ""
         self.protocol = environ["wsgi.url_scheme"]