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

Changeset 991

Show
Ignore:
Timestamp:
03/02/06 11:58:40
Author:
fumanchu
Message:

Fix for broken test in [990].

Files:

Legend:

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

    r990 r991  
    148148            if self.ready: 
    149149                # Request header is parsed 
    150                 # We prepare the SizeCheckWrapper for the request body 
    151150                script_name = self.environ.get('SCRIPT_NAME', '') 
    152151                path_info = self.environ.get('PATH_INFO', '') 
     
    154153                if path == "*": 
    155154                    path = "global" 
     155                 
     156                # Prepare the SizeCheckWrapper for the request body 
    156157                mbs = int(cherrypy.config.get('server.max_request_body_size', 
    157158                                              100 * 1024 * 1024, path=path)) 
    158                 if mbs > 0
    159                     if isinstance(self.rfile, httptools.SizeCheckWrapper)
     159                if isinstance(self.rfile, httptools.SizeCheckWrapper)
     160                    if mbs > 0
    160161                        self.rfile.bytes_read = 0 
    161162                        self.rfile.maxlen = mbs 
    162163                    else: 
     164                        # Unwrap the rfile 
     165                        self.rfile = self.rfile.rfile 
     166                else: 
     167                    if mbs > 0: 
    163168                        self.rfile = httptools.SizeCheckWrapper(self.rfile, mbs) 
     169                self.environ["wsgi.input"] = self.rfile 
    164170 
    165171 
  • trunk/cherrypy/test/test_core.py

    r970 r991  
    869869        if s: 
    870870            cherrypy.config.update({ 
    871                 '%s/maxrequestsize' % self.prefix(): {'server.max_request_body_size': 3}}) 
     871                '%s/maxrequestsize' % self.prefix(): { 
     872                    'server.max_request_body_size': 3}}) 
    872873            self.getPage('/maxrequestsize/upload', h, "POST", b) 
    873874            self.assertStatus("413 Request Entity Too Large") 

Hosted by WebFaction

Log in as guest/cpguest to create tickets