Permalink
Browse files

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
  • Loading branch information...
adrianholovaty committed Jul 20, 2005
1 parent 2012f7d commit e215ed36092807a558fcfa29492d7246ce6158ed
Showing with 4 additions and 4 deletions.
  1. +2 −2 django/core/handlers/modpython.py
  2. +2 −2 django/core/handlers/wsgi.py
@@ -258,9 +258,9 @@ def get_technical_error_response(self, is404=False):
Returns an HttpResponse that displays a TECHNICAL error message for a Returns an HttpResponse that displays a TECHNICAL error message for a
fundamental database or coding error. 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 responseClass = is404 and httpwrappers.HttpResponseNotFound or httpwrappers.HttpResponseServerError
return responseClass(error_string) return responseClass(error_string, mimetype='text/plain')
def _get_traceback(self): def _get_traceback(self):
"Helper function to return the traceback as a string" "Helper function to return the traceback as a string"
@@ -232,9 +232,9 @@ def get_technical_error_response(self, is404=False):
Returns an HttpResponse that displays a TECHNICAL error message for a Returns an HttpResponse that displays a TECHNICAL error message for a
fundamental database or coding error. 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 responseClass = is404 and httpwrappers.HttpResponseNotFound or httpwrappers.HttpResponseServerError
return responseClass(error_string) return responseClass(error_string, mimetype='text/plain')
def _get_traceback(self): def _get_traceback(self):
"Helper function to return the traceback as a string" "Helper function to return the traceback as a string"

0 comments on commit e215ed3

Please sign in to comment.