Files
Peter Meier 77ff44f6ef
Deploy / verify (push) Failing after 1m12s
Deploy / deploy (push) Has been skipped
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>
2026-06-12 22:58:28 +02:00

20 lines
668 B
JavaScript

import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
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'],
},
},
};
export default config;