Skip to content
Browse files

Fixed #3157 -- Made error message XHTML-friendly in CSRF middleware. …

…Thanks, mir@noris.de

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4225 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 8103b7d commit d9ce900e13077d47f8ca43064e904a38f7f1787e @adrianholovaty adrianholovaty committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/contrib/csrf/middleware.py
View
2 django/contrib/csrf/middleware.py
@@ -11,7 +11,7 @@
import re
import itertools
-_ERROR_MSG = "<h1>403 Forbidden</h1><p>Cross Site Request Forgery detected. Request aborted.</p>"
+_ERROR_MSG = '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><body><h1>403 Forbidden</h1><p>Cross Site Request Forgery detected. Request aborted.</p></body></html>'
_POST_FORM_RE = \
re.compile(r'(<form\W[^>]*\bmethod=(\'|"|)POST(\'|"|)\b[^>]*>)', re.IGNORECASE)

0 comments on commit d9ce900

Please sign in to comment.
Something went wrong with that request. Please try again.