diff -r 57b4279d8c4e -r 03e267d67478 app/django/contrib/csrf/middleware.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/django/contrib/csrf/middleware.py Fri Jul 18 18:22:23 2008 +0000 @@ -0,0 +1,93 @@ +""" +Cross Site Request Forgery Middleware. + +This module provides a middleware that implements protection +against request forgeries from other sites. + +""" +from django.conf import settings +from django.http import HttpResponseForbidden +from django.utils.safestring import mark_safe +import md5 +import re +import itertools + +_ERROR_MSG = mark_safe('
Cross Site Request Forgery detected. Request aborted.
') + +_POST_FORM_RE = \ + re.compile(r'(