mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	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:
		| @@ -258,9 +258,9 @@ class ModPythonHandler: | |||||||
|         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 @@ class WSGIHandler: | |||||||
|         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" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user