From: Ben Darnell Date: Sat, 16 Apr 2011 20:26:03 +0000 (-0700) Subject: Convert WSGI content-length variable to an int at the right place X-Git-Tag: v2.0.0~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8eef796afddada403844a2f8aafb59eb2104e854;p=thirdparty%2Ftornado.git Convert WSGI content-length variable to an int at the right place Closes #245 --- diff --git a/tornado/wsgi.py b/tornado/wsgi.py index 6bf180f90..7c261ffe4 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -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"]