Commits

ianb  committed d1591de

be more tolerant of bad CONTENT_LENGTH

  • Participants
  • Parent commits a03cb42
  • Tags 1.5.1

Comments (0)

Files changed (2)

File docs/news.txt

 
 .. contents::
 
+svn trunk
+---------
+
+* Make ``paste.cascade`` more tolerant of a missing or invalid
+  Content-Length.
+
 1.5
 ---
 

File paste/cascade.py

                 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