Skip to content

Commit

Permalink
Convert WSGI content-length variable to an int at the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed Apr 16, 2011
1 parent 3ae6787 commit 8eef796
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tornado/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def __init__(self, environ):
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"]
Expand Down

0 comments on commit 8eef796

Please sign in to comment.