Get CONTENT_LENGTH as it may be absent

This commit is contained in:
Guillaume Ayoub 2011-05-01 19:08:15 +02:00
parent 0202756540
commit 421189e263

View File

@ -129,7 +129,7 @@ class Application(object):
log.LOGGER.debug("Request headers:\n%s" % environ.items())
# Get content
content_length = int(environ["CONTENT_LENGTH"] or 0)
content_length = int(environ.get("CONTENT_LENGTH", 0))
if content_length:
content = self.decode(
environ["wsgi.input"].read(content_length), environ)