diff options
| author | ianb <devnull@localhost> | 2007-10-22 16:25:29 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2007-10-22 16:25:29 +0000 |
| commit | cb91909c0121fc5104ad3b96c7d4e71e8289a864 (patch) | |
| tree | 5c9f08e2a02e0c6e816f39e958b229222f3e21a6 | |
| parent | f64031047161acdf1f6e8aab5b1f4958268d3605 (diff) | |
| download | paste-1.5.1.tar.gz | |
be more tolerant of bad CONTENT_LENGTH1.5.1
| -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 |
