From afc6985267609d7782ec01817b051267fef48cd1 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 3 Sep 2007 06:18:48 +0000 Subject: [PATCH] Fixed #5292 -- Changed CSRF middleware to check for request.method == 'POST' instead of request.POST dictionary not being empty. Thanks, Jakub Wilk git-svn-id: http://code.djangoproject.com/svn/django/trunk@6038 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/csrf/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/csrf/middleware.py b/django/contrib/csrf/middleware.py index 93a9484ca6..1ef0e6cefd 100644 --- a/django/contrib/csrf/middleware.py +++ b/django/contrib/csrf/middleware.py @@ -40,7 +40,7 @@ class CsrfMiddleware(object): """ def process_request(self, request): - if request.POST: + if request.method == 'POST': try: session_id = request.COOKIES[settings.SESSION_COOKIE_NAME] except KeyError: