Changeset 1616
- Timestamp:
- 02/08/07 12:25:52
- Files:
-
- trunk/cherrypy/_cprequest.py (modified) (2 diffs)
- trunk/cherrypy/wsgiserver/__init__.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cprequest.py
r1614 r1616 630 630 def process_body(self): 631 631 """Convert request.rfile into request.params (or request.body). (Core)""" 632 if not self.headers.get("Content-Length", ""): 633 # No Content-Length header supplied (or it's 0). 634 # If we went ahead and called cgi.FieldStorage, it would hang, 635 # since it cannot determine when to stop reading from the socket. 636 # See http://www.cherrypy.org/ticket/493. 637 # See also http://www.cherrypy.org/ticket/650. 638 # Note also that we expect any HTTP server to have decoded 639 # any message-body that had a transfer-coding, and we expect 640 # the HTTP server to have supplied a Content-Length header 641 # which is valid for the decoded entity-body. 642 return 643 632 644 # FieldStorage only recognizes POST, so fake it. 633 645 methenv = {'REQUEST_METHOD': "POST"} … … 816 828 self.timed_out = True 817 829 830 trunk/cherrypy/wsgiserver/__init__.py
r1615 r1616 267 267 if read_chunked: 268 268 if not self.decode_chunked(): 269 return270 else:271 cl = environ.get("CONTENT_LENGTH")272 if method in ("POST", "PUT") and cl is None:273 # No Content-Length header supplied. This will hang274 # cgi.FieldStorage, since it cannot determine when to275 # stop reading from the socket.276 # See http://www.cherrypy.org/ticket/493.277 self.simple_response("411 Length Required")278 269 return 279 270 … … 1006 997 self.ssl_environ[wsgikey] = value 1007 998 999

