♻️(backend) align CSRF token header with Django conventions

Update the CSRF header naming to follow Django standards,
avoiding duplicated client-side logic with inconsistent
header names.
This commit is contained in:
lebaudantoine
2026-04-29 11:07:13 +02:00
parent 6ee89b201e
commit 181b97b310
2 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -106,7 +106,7 @@ class SessionViewSet(viewsets.ViewSet):
"""Poll a session for its current state and, if terminal, consume it.
Authenticates the caller using the addonsSid cookie (set by
/init) together with the X-CSRF-Token header, which must match
/init) together with the X-CSRFToken header, which must match
the CSRF token issued for that session. The session id alone is not
sufficient — both must be presented and must correspond.
@@ -127,7 +127,7 @@ class SessionViewSet(viewsets.ViewSet):
"""
session_id = request.COOKIES.get(settings.ADDONS_SESSION_ID_COOKIE)
submitted_csrf = request.headers.get("X-CSRF-Token")
submitted_csrf = request.headers.get("X-CSRFToken")
if not session_id:
return drf_response.Response(