Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit afc6985267609d7782ec01817b051267fef48cd1 1 parent 8e3507c
Adrian Holovaty adrianholovaty authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/contrib/csrf/middleware.py
2  django/contrib/csrf/middleware.py
View
@@ -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:
Please sign in to comment.
Something went wrong with that request. Please try again.