Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #650: putnobody.patch

  • _cprequest.py

    old new  
    1 """CherryPy core request/response handling.""" 
    21 
    32import Cookie 
    43import os 
     
    643642     
    644643    def process_body(self): 
    645644        """Convert request.rfile into request.params (or request.body).""" 
     645        if not self.headers.get("Content-Length", ""): 
     646            # No Content-Length header supplied (or it's 0). 
     647            # If we went ahead and called cgi.FieldStorage, it would hang, 
     648            # since it cannot determine when to stop reading from the socket. 
     649            # See http://www.cherrypy.org/ticket/493. 
     650            # See also http://www.cherrypy.org/ticket/650. 
     651            # Note also that we expect any HTTP server to have decoded 
     652            # any message-body that had a transfer-coding, and we expect 
     653            # the HTTP server to have supplied a Content-Length header 
     654            # which is valid for the decoded entity-body. 
     655            return 
     656         
    646657        # FieldStorage only recognizes POST, so fake it. 
    647658        methenv = {'REQUEST_METHOD': "POST"} 
    648659        try: 
  • wsgiserver/__init__.py

    old new  
    267267        if read_chunked: 
    268268            if not self.decode_chunked(): 
    269269                return 
    270         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 hang 
    274                 # cgi.FieldStorage, since it cannot determine when to 
    275                 # stop reading from the socket. 
    276                 # See http://www.cherrypy.org/ticket/493. 
    277                 self.simple_response("411 Length Required") 
    278                 return 
    279270         
    280271        # From PEP 333: 
    281272        # "Servers and gateways that implement HTTP 1.1 must provide 

Hosted by WebFaction

Log in as guest/cpguest to create tickets