### fix: behebe CORS-Probleme und Stabilitätsfehler
Build and Publish Docker Images / build-and-push (., backend/services/mail/Dockerfile, mail-service, mail-service) (push) Successful in 6m0s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 3m55s

- **MailController:** Erweitere `@CrossOrigin`-Headers und Methoden für Preflight-Checks.
- **GlobalSecurityConfig:** Reaktiviere CORS und füge explizite `CorsConfigurationSource` hinzu.
- **Tests:** Fix für `NoSuchBeanDefinitionException` bei Integrationstests.
- **UI:** Aktualisiere Versionsmarker auf `v2026-04-23.15 - CORS STABILITY`.
This commit is contained in:
2026-04-23 10:53:52 +02:00
parent af02e14f2d
commit 3244efd5e0
4 changed files with 48 additions and 7 deletions
@@ -44,3 +44,18 @@ Die "Hallo Du!" Test-UI wurde durch produktive, fachlich korrekte Formulare erse
- `PlatformConfig.wasmJs.kt`: Alle Logiken zur Erkennung von URLs wurden temporär deaktiviert. Die Funktionen `resolveMailServiceUrl()` und `resolveApiBaseUrl()` geben nun **zwingend** `https://api.mo-code.at` zurück.
- Dies umgeht jegliches Caching von `index.html` oder fälschlich injizierte Umgebungsvariablen.
- UI-Marker auf `v2026-04-23.13 - RADICAL HTTPS PRIORITIZATION` aktualisiert.
### 2026-04-23 10:45 - Version 14: CORS Reanimation
- **Problem**: Trotz HTTPS-Fix blockierte die CORS-Policy im Backend die Anfragen von `https://app.mo-code.at`.
- **Lösung**:
- `GlobalSecurityConfig.kt`: CORS explizit wieder aktiviert (`.cors { }`), da Microservices im Plan-B direkt (ohne Gateway) angesprochen werden könnten.
- `MailController.kt`: `@CrossOrigin` um explizite Header (`allowedHeaders = ["*"]`) und Methoden (`methods = [...]`) erweitert, um Preflight-Checks (OPTIONS) korrekt zu bedienen.
- UI-Marker auf `v2026-04-23.14 - CORS REANIMATION` aktualisiert.
### 2026-04-23 11:00 - Version 15: CORS Stability & Test Fix
- **Problem**: Aktivierung von `.cors { }` in `GlobalSecurityConfig.kt` verursachte `NoSuchBeanDefinitionException` in Spring-Integration-Tests, da keine `CorsConfigurationSource` Bean definiert war.
- **Lösung**:
- `GlobalSecurityConfig.kt`: Explizite `CorsConfigurationSource` Bean implementiert, die sowohl lokale Entwicklungsumgebungen (`localhost`) als auch produktive URLs (`*.mo-code.at`) whitelisted.
- Integration von `it.configurationSource(corsConfigurationSource())` in die `filterChain` zur Behebung der Testfehler.
- UI-Marker auf `v2026-04-23.15 - CORS STABILITY` aktualisiert.
- Verifiziert durch erfolgreichen Durchlauf des `EntriesIsolationIntegrationTest`.