summaryrefslogtreecommitdiff
path: root/paste/cascade.py
diff options
context:
space:
mode:
Diffstat (limited to 'paste/cascade.py')
-rw-r--r--paste/cascade.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/paste/cascade.py b/paste/cascade.py
index d939e4a..adb0907 100644
--- a/paste/cascade.py
+++ b/paste/cascade.py
@@ -76,7 +76,10 @@ class Cascade(object):
return _consuming_writer
return start_response(status, headers, exc_info)
- length = int(environ.get('CONTENT_LENGTH', '0'))
+ try:
+ length = int(environ.get('CONTENT_LENGTH', 0) or 0)
+ except ValueError:
+ length = 0
if length > 0:
# We have to copy wsgi.input
copy_wsgi_input = True