diff options
-rw-r--r-- | docs/news.txt | 6 | ||||
-rw-r--r-- | paste/cascade.py | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/docs/news.txt b/docs/news.txt index 5eb1c5b..96a1ab6 100644 --- a/docs/news.txt +++ b/docs/news.txt @@ -3,6 +3,12 @@ News .. contents:: +svn trunk +--------- + +* Make ``paste.cascade`` more tolerant of a missing or invalid + Content-Length. + 1.5 --- 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 |