Skip to content

Commit

Permalink
Read a fixed number of bytes for wsgi input, since some wsgi containers
Browse files Browse the repository at this point in the history
do not signal EOF.
  • Loading branch information
bdarnell committed Feb 22, 2011
1 parent 83d4e93 commit 2f4835a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tornado/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def __init__(self, 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.body = environ["wsgi.input"].read(
self.headers["Content-Length"])
else:
self.body = ""
self.protocol = environ["wsgi.url_scheme"]
Expand Down

0 comments on commit 2f4835a

Please sign in to comment.