Ticket #8127: csrf_middleware_ajax_flash_patch.diff
File csrf_middleware_ajax_flash_patch.diff, 824 bytes (added by , 16 years ago) |
---|
-
middleware.py
43 43 def process_request(self, request): 44 44 if request.method == 'POST': 45 45 try: 46 session_id = request. COOKIES[settings.SESSION_COOKIE_NAME]46 session_id = request.POST['session_id'] 47 47 except KeyError: 48 # No session, no check required 49 return None 48 try: 49 session_id = request.COOKIES[settings.SESSION_COOKIE_NAME] 50 except KeyError: 51 # No session, no check required 52 return None 50 53 51 54 csrf_token = _make_token(session_id) 52 55 # check incoming token