Fixed #102 -- Now using text/plain mimetype for exceptions displayed in the browser, so angle brackets are no longer an issue
git-svn-id: http://code.djangoproject.com/svn/django/trunk@241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2012f7df63
commit
e215ed3609
|
@ -258,9 +258,9 @@ class ModPythonHandler:
|
|||
Returns an HttpResponse that displays a TECHNICAL error message for a
|
||||
fundamental database or coding error.
|
||||
"""
|
||||
error_string = "<pre>There's been an error:\n\n%s</pre>" % self._get_traceback()
|
||||
error_string = "There's been an error:\n\n%s" % self._get_traceback()
|
||||
responseClass = is404 and httpwrappers.HttpResponseNotFound or httpwrappers.HttpResponseServerError
|
||||
return responseClass(error_string)
|
||||
return responseClass(error_string, mimetype='text/plain')
|
||||
|
||||
def _get_traceback(self):
|
||||
"Helper function to return the traceback as a string"
|
||||
|
|
|
@ -232,9 +232,9 @@ class WSGIHandler:
|
|||
Returns an HttpResponse that displays a TECHNICAL error message for a
|
||||
fundamental database or coding error.
|
||||
"""
|
||||
error_string = "<pre>There's been an error:\n\n%s</pre>" % self._get_traceback()
|
||||
error_string = "There's been an error:\n\n%s" % self._get_traceback()
|
||||
responseClass = is404 and httpwrappers.HttpResponseNotFound or httpwrappers.HttpResponseServerError
|
||||
return responseClass(error_string)
|
||||
return responseClass(error_string, mimetype='text/plain')
|
||||
|
||||
def _get_traceback(self):
|
||||
"Helper function to return the traceback as a string"
|
||||
|
|
Loading…
Reference in New Issue