Manage empty strings for CONTENT_LENGTH header

This commit is contained in:
Guillaume Ayoub 2011-05-06 15:02:29 +02:00
parent a2f1e173d6
commit 51853a22bc

View File

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