diff --git a/config/docker/caddy/web-app/Caddyfile b/config/docker/caddy/web-app/Caddyfile index 12c7ce4b..60bd882c 100644 --- a/config/docker/caddy/web-app/Caddyfile +++ b/config/docker/caddy/web-app/Caddyfile @@ -17,17 +17,18 @@ encode gzip zstd - # Reverse Proxy: Plan-B leitet nur /api/mail an den Mail-Service weiter + # CORS-Handshaking direkt im Proxy + # Wir erlauben ALLES für die Domain mo-code.at im Plan-B Modus handle /api/mail/* { @options method OPTIONS handle @options { header { Access-Control-Allow-Origin "https://app.mo-code.at" Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" - Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With" + Access-Control-Allow-Headers "*" Access-Control-Allow-Credentials "true" Access-Control-Max-Age "3600" - X-Caddy-CORS "preflight" + X-Caddy-CORS "preflight-v25" } respond "" 204 } @@ -35,9 +36,9 @@ header { Access-Control-Allow-Origin "https://app.mo-code.at" Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" - Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With" + Access-Control-Allow-Headers "*" Access-Control-Allow-Credentials "true" - X-Caddy-CORS "forward" + X-Caddy-CORS "forward-v25" defer } diff --git a/docs/03_Journal/2026-04-23_Plan-B-Formulare.md b/docs/03_Journal/2026-04-23_Plan-B-Formulare.md index 844419b9..66384123 100644 --- a/docs/03_Journal/2026-04-23_Plan-B-Formulare.md +++ b/docs/03_Journal/2026-04-23_Plan-B-Formulare.md @@ -100,3 +100,10 @@ Die "Hallo Du!" Test-UI wurde durch produktive, fachlich korrekte Formulare erse - Hinzufügen von `X-Requested-With` zu den erlaubten Headern (oft von KMP/Ktor-Clients verwendet). - Entfernung von `*` aus den Allowed-Headers, um maximale Kompatibilität mit restriktiven Browsern sicherzustellen. - **Status**: Versionsmarker auf v2026-04-23.24 aktualisiert. + +### v2026-04-23.25 - CADDY CATCH-ALL CORS +- **Problem**: Preflight (OPTIONS) weiterhin blockiert (v24). Wahrscheinlich waren die Header-Beschränkungen in v24 immer noch zu strikt für den Ktor/Wasm Client. +- **Lösung**: + - `Caddyfile` radikal gelockert: `Access-Control-Allow-Headers` auf `*` gesetzt. + - CORS-Identifikatoren auf `-v25` aktualisiert, um sicherzugehen, dass der frische Proxy-Stand aktiv ist. +- **Status**: Versionsmarker auf v2026-04-23.25 aktualisiert. Finaler Versuch vor der Deadline. diff --git a/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt b/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt index b8f393a2..81d6dce2 100644 --- a/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt +++ b/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt @@ -124,7 +124,7 @@ fun MainAppContent() { // Dezentraler Versions-Marker in der unteren rechten Ecke Box(modifier = Modifier.fillMaxSize().padding(8.dp), contentAlignment = Alignment.BottomEnd) { Text( - text = "v2026-04-23.24 - CADDY CORS FINAL BOSS", + text = "v2026-04-23.25 - CADDY CATCH-ALL CORS", style = MaterialTheme.typography.labelSmall, color = Color.LightGray.copy(alpha = 0.5f) )