From 8eef796afddada403844a2f8aafb59eb2104e854 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sat, 16 Apr 2011 13:26:03 -0700 Subject: [PATCH] Convert WSGI content-length variable to an int at the right place Closes #245 --- tornado/wsgi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"] -- 2.47.3