fix(csrf): non-www-Canonical + trustedOrigins für www-Fallback
SvelteKits CSRF-Check blockte multipart-POSTs (/api/mitmachen) mit 403: ORIGIN env stand auf www, Caddy redirected aber www -> non-www — jeder Besucher war auf non-www, Origin-Header passte nie. Env-Flip auf non-www (secrets), hier: www als trustedOrigin-Fallback + Kit-Bump auf ^2.65 (trustedOrigins gibt es ab 2.23). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,14 @@ const config = {
|
||||
preprocess: vitePreprocess(),
|
||||
kit: {
|
||||
adapter: adapter(),
|
||||
csrf: {
|
||||
// SvelteKits Origin-Check vergleicht gegen env ORIGIN (non-www,
|
||||
// kanonisch — Caddy redirected www → non-www). www als Fallback
|
||||
// vertrauen, falls ein Client den Redirect umgeht; multipart-POSTs
|
||||
// (Mitmachen-Formular) liefen sonst in "Cross-site POST form
|
||||
// submissions are forbidden". Die API-Routen prüfen Origin zusätzlich.
|
||||
trustedOrigins: ['https://www.windwiderstand.de'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user