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

Ticket #790: cp3_no_content_type2.patch

  • cherrypy/_cprequest.py

    old new  
    685685        # FieldStorage only recognizes POST, so fake it. 
    686686        methenv = {'REQUEST_METHOD': "POST"} 
    687687        try: 
     688            # If the headers are missing "Content-Type" then add one 
     689            # with an empty ("") value.  This ensures that FieldStorage 
     690            # won't parse the request body for params if the client 
     691            # didn't provide a "Content-Type" header. 
     692            # A copy of the headers is passed to FieldStorage so that 
     693            # we leave the original set unmodified. 
     694            h = http.HeaderMap(self.headers.items()) 
     695            h.setdefault('Content-Type', '') 
     696             
    688697            forms = _cpcgifs.FieldStorage(fp=self.rfile, 
    689                                           headers=self.headers
     698                                          headers=h
    690699                                          environ=methenv, 
    691700                                          keep_blank_values=1) 
    692701        except http.MaxSizeExceeded: 

Hosted by WebFaction

Log in as guest/cpguest to create tickets