Changeset 1319
- Timestamp:
- 09/02/06 13:39:10
- Files:
-
- trunk/cherrypy/_cpmodpy.py (modified) (1 diff)
- trunk/cherrypy/_cptools.py (modified) (1 diff)
- trunk/cherrypy/lib/cptools.py (modified) (1 diff)
- trunk/cherrypy/test/modpy.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpmodpy.py
r1275 r1319 19 19 func() 20 20 21 cherrypy.config.update({'log.screen': False}) 21 cherrypy.config.update({'log.screen': False, 22 "tools.ignore_headers.on": True, 23 "tools.ignore_headers.headers": ['Range'], 24 }) 22 25 23 26 if cherrypy.engine.state == cherrypy._cpengine.STOPPED: trunk/cherrypy/_cptools.py
r1311 r1319 313 313 default_toolbox.tidy = Tool('before_finalize', tidy.tidy) 314 314 default_toolbox.nsgmls = Tool('before_finalize', tidy.nsgmls) 315 default_toolbox.ignore_headers = Tool('before_request_body', cptools.ignore_headers) 315 316 316 317 trunk/cherrypy/lib/cptools.py
r1303 r1319 121 121 xff = xff.split(',')[-1].strip() 122 122 request.remote.ip = xff 123 124 125 def ignore_headers(headers=('Range',)): 126 """Delete request headers whose field names are included in 'headers'. 127 128 This is a useful tool for working behind certain HTTP servers; 129 for example, Apache duplicates the work that CP does for 'Range' 130 headers, and will doubly-truncate the response. 131 """ 132 request = cherrypy.request 133 for name in headers: 134 if name in request.headers: 135 del request.headers[name] 123 136 124 137 trunk/cherrypy/test/modpy.py
r1317 r1319 111 111 import cherrypy 112 112 cherrypy.config.update({ 113 "log.error .file": os.path.join(curdir, "test.log"),113 "log.error_file": os.path.join(curdir, "test.log"), 114 114 "environment": "production", 115 115 })

