Commit afc624a5 authored by Amos Latteier's avatar Amos Latteier

Fixed a bug in the detection on HTML error messages which could mess up error message formatting.

parent 25a82bf4
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
'''CGI Response Output formatter '''CGI Response Output formatter
$Id: HTTPResponse.py,v 1.18 1999/08/04 20:50:22 jim Exp $''' $Id: HTTPResponse.py,v 1.19 1999/08/18 00:23:50 amos Exp $'''
__version__='$Revision: 1.18 $'[11:-2] __version__='$Revision: 1.19 $'[11:-2]
import string, types, sys, regex import string, types, sys, regex
from string import find, rfind, lower, upper, strip, split, join, translate from string import find, rfind, lower, upper, strip, split, join, translate
...@@ -625,7 +625,7 @@ class HTTPResponse(BaseResponse): ...@@ -625,7 +625,7 @@ class HTTPResponse(BaseResponse):
self._traceback(t,v,tb)), self._traceback(t,v,tb)),
is_error=1) is_error=1)
elif lower(strip(b))[:6]=='<html>': elif lower(strip(b))[:6]=='<html>' or lower(strip(b))[:14]=='<!doctype html':
# error is an HTML document, not just a snippet of html # error is an HTML document, not just a snippet of html
tb=self.setBody(b + self._traceback(t,'(see above)',tb), tb=self.setBody(b + self._traceback(t,'(see above)',tb),
is_error=1) is_error=1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment