test(middleware): expect CSRF cookie readable by script for header submit

This commit is contained in:
2026-05-06 20:07:35 +02:00
parent 2adf72c138
commit 4e188eb8d5
+2 -2
View File
@@ -242,8 +242,8 @@ func TestSetCSRFToken(t *testing.T) {
t.Errorf("Expected cookie value %s, got %s", token, cookie.Value)
}
if !cookie.HttpOnly {
t.Error("CSRF token cookie should be HttpOnly")
if cookie.HttpOnly {
t.Error("CSRF token cookie must not be HttpOnly so JS can mirror it to X-CSRF-Token")
}
if cookie.SameSite != http.SameSiteLaxMode {