Changeset 1271
- Timestamp:
- 08/23/06 14:38:25
- Files:
-
- trunk/cherrypy/_cprequest.py (modified) (2 diffs)
- trunk/cherrypy/test/test_core.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cprequest.py
r1268 r1271 102 102 rfile = None 103 103 process_request_body = True 104 methods_with_bodies = ("POST", "PUT") 104 105 body = None 105 106 body_read = False … … 257 258 self.hooks.run('on_start_resource') 258 259 259 if self.process_request_body andnot self.body_read:260 # Check path-specific methods_with_bodies.261 meths = self.config.get("methods_with_bodies", ("POST", "PUT"))262 self.process_request_body = self.method in meths260 if not self.body_read: 261 if self.process_request_body: 262 if self.method not in self.methods_with_bodies: 263 self.process_request_body = False 263 264 264 # Prepare the SizeCheckWrapper for the request body 265 mbs = int(self.config.get('server.max_request_body_size', 266 100 * 1024 * 1024)) 267 if mbs > 0: 268 self.rfile = http.SizeCheckWrapper(self.rfile, mbs) 265 if self.process_request_body: 266 # Prepare the SizeCheckWrapper for the request body 267 mbs = int(self.config.get('server.max_request_body_size', 268 100 * 1024 * 1024)) 269 if mbs > 0: 270 self.rfile = http.SizeCheckWrapper(self.rfile, mbs) 269 271 270 272 self.hooks.run('before_request_body') trunk/cherrypy/test/test_core.py
r1263 r1271 378 378 'server.max_request_header_size': 500, 379 379 }) 380 381 def expand_methods(): 382 cherrypy.request.methods_with_bodies = ("POST", "PUT", "PROPFIND") 380 383 appconf = { 381 384 '/': {'log_access_file': log_access_file}, 382 '/method': {' methods_with_bodies': ("POST", "PUT", "PROPFIND")},385 '/method': {'hooks.on_start_resource': expand_methods}, 383 386 } 384 387 cherrypy.tree.mount(root, conf=appconf)

