### fix: verbessere CORS-Handling im Caddy-Proxy
All checks were successful
Build and Publish Docker Images / build-and-push (., backend/services/mail/Dockerfile, mail-service, mail-service) (push) Successful in 5m36s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 3m51s

- **Caddyfile:** `Access-Control-Allow-Headers` auf `*` gelockert, Versionsmarkers angepasst.
- **UI:** Aktualisierung des Versionsmarkers auf `v2026-04-23.25 - CADDY CATCH-ALL CORS`.
- **Docs:** Ergänzung der Analyse und Lösung für Version 25.
This commit is contained in:
Stefan Mogeritsch 2026-04-23 14:21:23 +02:00
parent 02a778751a
commit f97bfeff47
3 changed files with 14 additions and 6 deletions

View File

@ -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
}

View File

@ -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.

View File

@ -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)
)