Changeset 616
- Timestamp:
- 09/08/05 11:16:52
- Files:
-
- trunk/CHANGELOG.txt (modified) (1 diff)
- trunk/cherrypy/_cpcgifs.py (modified) (2 diffs)
- trunk/cherrypy/_cphttptools.py (modified) (1 diff)
- trunk/cherrypy/server.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CHANGELOG.txt
r532 r616 1 2005-09-04: 2 * Generalized mechanism for handling HTTP errors 3 * raising a HTTPStatusError will automatically send an appropriate error page 4 * All errors in production mode will cause CP to respond with a http error 5 1 6 2005-08-17: 2 7 * The session filter has been simplified, the mechanism for creating multiple sessions has been removed. However .. (mikerobi) trunk/cherrypy/_cpcgifs.py
r608 r616 1 1 import cgi 2 2 import cherrypy 3 4 try:5 from threading import local6 except ImportError:7 from cherrypy._cpthreadinglocal import local8 3 9 4 class LocalInt: … … 24 19 return str(self.__local.value) 25 20 26 cgi.maxlen = LocalInt(0)27 28 21 class FieldStorage(cgi.FieldStorage): 29 22 def __init__(self, *args, **kwds): 30 maxlen = cherrypy.config.get('server.maxRequestSize')31 cgi.maxlen.setValue(maxlen)32 23 try: 33 24 cgi.FieldStorage.__init__(self, *args, **kwds) 34 except ValueError: 35 raise cherrypy.HTTPStatusError(status=413) 25 except ValueError, ex: 26 if str(ex) == 'Maximum content length exceeded': 27 raise cherrypy.HTTPStatusError(status=413) 28 else: 29 raise ex 36 30 37 31 def read_lines_to_eof(self): trunk/cherrypy/_cphttptools.py
r608 r616 461 461 if not extrabody: 462 462 extrabody = '' 463 status, _body = httperrors.getErrorPage(500, extrabody)463 status, _body = cherrypy.lib.httperrors.getErrorPage(500, extrabody) 464 464 headers = [('Content-Length', str(len(_body))), ('Content-Type', 'text/html')] 465 465 return (status, headers, _body) trunk/cherrypy/server.py
r583 r616 93 93 and cherrypy.config.get('session.storageType') == 'file'): 94 94 cherrypy._sessionFileLock = threading.RLock() 95 96 # set cgi.maxlen which will limit the size of POST request bodies 97 import cgi 98 cgi.maxlen = cherrypy.config.get('server.maxRequestSize') 95 99 96 100 # Call the functions from cherrypy.server.onStartServerList

