Ticket #3157: csrf_xhtml.diff

File csrf_xhtml.diff, 606 bytes (added by mir@…, 18 years ago)

patch

  • django/contrib/csrf/middleware.py

    diff --git a/django/contrib/csrf/middleware.py b/django/contrib/csrf/middleware.py
    a b import md5  
    1111import re
    1212import itertools
    1313
    14 _ERROR_MSG = "<h1>403 Forbidden</h1><p>Cross Site Request Forgery detected.  Request aborted.</p>"
     14_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>'
    1515
    1616_POST_FORM_RE = \
    1717    re.compile(r'(<form\W[^>]*\bmethod=(\'|"|)POST(\'|"|)\b[^>]*>)', re.IGNORECASE)
Back to Top