Changeset 799
- Timestamp:
- 11/08/05 16:18:40
- Files:
-
- trunk/cherrypy/_cputil.py (modified) (2 diffs)
- trunk/cherrypy/test/helper.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cputil.py
r790 r799 228 228 # so don't bother cleaning up response values here. 229 229 response.status = status 230 response.body = getErrorPage(status, traceback=tb, message=message) 231 response.headerMap['Content-Length'] = len(response.body) 230 232 response.headerMap['Content-Type'] = "text/html" 231 response.body = getErrorPage(status, traceback=tb, message=message)232 233 233 234 be_ie_unfriendly(status) 234 235 response.headerMap['Content-Length'] = len(response.body)236 235 237 236 … … 265 264 else: 266 265 response.body = [content] 266 response.headerMap['Content-Length'] = len(response.body[0]) 267 267 268 268 def formatExc(exc=None): trunk/cherrypy/test/helper.py
r768 r799 136 136 137 137 from cherrypy._cputil import getErrorPage 138 esc = re.escape138 139 139 # This will never contain a traceback: 140 page = esc(getErrorPage(status, message=message))140 page = getErrorPage(status, message=message) 141 141 142 142 # First, test the response body without checking the traceback. 143 143 # Stick a match-all group (.*) in to grab the traceback. 144 page = page.replace(esc('<pre id="traceback"></pre>'), 145 esc('<pre id="traceback">') + '(.*)' + esc('</pre>')) 146 m = re.match(page, self.body, re.DOTALL) 144 esc = re.escape 145 epage = esc(page) 146 epage = epage.replace(esc('<pre id="traceback"></pre>'), 147 esc('<pre id="traceback">') 148 + '(.*)' + esc('</pre>')) 149 m = re.match(epage, self.body, re.DOTALL) 147 150 if not m: 148 151 self._handlewebError('Error page does not match\n' + page)

