Ticket #10884: csrf_re_patch.diff
File csrf_re_patch.diff, 677 bytes (added by , 16 years ago) |
---|
-
django/contrib/csrf/middleware.py
20 20 _ERROR_MSG = mark_safe('<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>') 21 21 22 22 _POST_FORM_RE = \ 23 re.compile(r'(<form\W[^>]*\bmethod =(\'|"|)POST(\'|"|)\b[^>]*>)', re.IGNORECASE)23 re.compile(r'(<form\W[^>]*\bmethod\s*=\s*(\'|"|)POST(\'|"|)\b[^>]*>)', re.IGNORECASE) 24 24 25 25 _HTML_TYPES = ('text/html', 'application/xhtml+xml') 26 26