1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #32902 -- Fixed CsrfViewMiddleware.process_response()'s cookie reset logic.

Thanks Florian Apolloner and Shai Berger for reviews.
This commit is contained in:
Chris Jerdonek
2021-07-16 10:54:42 -04:00
committed by Mariusz Felisiak
parent 311401d9a2
commit a2e1f1e295
3 changed files with 60 additions and 12 deletions

View File

@@ -33,6 +33,17 @@ class _CsrfCookieRotator(MiddlewareMixin):
csrf_rotating_token = decorator_from_middleware(_CsrfCookieRotator)
@csrf_protect
def protected_view(request):
return HttpResponse('OK')
@csrf_protect
@ensure_csrf_cookie
def ensured_and_protected_view(request):
return TestingHttpResponse('OK')
@csrf_protect
@csrf_rotating_token
@ensure_csrf_cookie