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
This commit is contained in:
Adrian Holovaty 2007-09-03 06:18:48 +00:00
parent 8e3507cd3e
commit afc6985267
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class CsrfMiddleware(object):
""" """
def process_request(self, request): def process_request(self, request):
if request.POST: if request.method == 'POST':
try: try:
session_id = request.COOKIES[settings.SESSION_COOKIE_NAME] session_id = request.COOKIES[settings.SESSION_COOKIE_NAME]
except KeyError: except KeyError: