Kaydet (Commit) afc69852 authored tarafından Adrian Holovaty's avatar Adrian Holovaty

Fixed #5292 -- Changed CSRF middleware to check for request.method == 'POST'…

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
üst 8e3507cd
...@@ -40,7 +40,7 @@ class CsrfMiddleware(object): ...@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment