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

Changeset 1970

Show
Ignore:
Timestamp:
05/25/08 15:02:04
Author:
fumanchu
Message:

Minor refactor and dropping an unused import.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cprequest.py

    r1949 r1970  
    701701            raise cherrypy.HTTPError(411) 
    702702         
    703         # FieldStorage only recognizes POST, so fake it. 
    704         methenv = {'REQUEST_METHOD': "POST"} 
     703        # If the headers are missing "Content-Type" then add one 
     704        # with an empty value.  This ensures that FieldStorage 
     705        # won't parse the request body for params if the client 
     706        # didn't provide a "Content-Type" header. 
     707        if 'Content-Type' not in self.headers: 
     708            h = http.HeaderMap(self.headers.items()) 
     709            h['Content-Type'] = '' 
     710        else: 
     711            h = self.headers 
     712         
    705713        try: 
    706             # If the headers are missing "Content-Type" then add one 
    707             # with an empty value.  This ensures that FieldStorage 
    708             # won't parse the request body for params if the client 
    709             # didn't provide a "Content-Type" header. 
    710             if 'Content-Type' not in self.headers: 
    711                 h = http.HeaderMap(self.headers.items()) 
    712                 h['Content-Type'] = '' 
    713             else: 
    714                 h = self.headers 
    715              
    716714            forms = _cpcgifs.FieldStorage(fp=self.rfile, 
    717715                                          headers=h, 
    718                                           environ=methenv, 
     716                                          # FieldStorage only recognizes POST. 
     717                                          environ={'REQUEST_METHOD': "POST"}, 
    719718                                          keep_blank_values=1) 
    720719        except http.MaxSizeExceeded: 
  • trunk/cherrypy/lib/http.py

    r1967 r1970  
    378378 
    379379 
    380 from cherrypy.wsgiserver import SizeCheckWrapper, MaxSizeExceeded 
     380from cherrypy.wsgiserver import MaxSizeExceeded 
    381381 
    382382 

Hosted by WebFaction

Log in as guest/cpguest to create tickets