Profilbild-Upload (413 + Auto-Skalierung) und CSRF aktivieren

- application.properties: multipart max-file/request-size auf 10MB
  (nginx client_max_body_size muss serverseitig passend gesetzt sein)
- ProfileController: hochgeladene Profilbilder werden serverseitig auf
  max. 400px herunterskaliert und als JPEG normalisiert gespeichert
  (statt der Originaldatei roh); nicht lesbare Bilder werden ignoriert
- SecurityConfig: CSRF aktiviert; Spiele-JSON-APIs (/api/games,
  /api/techtacular, /api/mindmatch) ausgenommen; GET-Logout erlaubt,
  da die Logout-Links in den Templates GET sind

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
AliceDarkest
2026-06-26 15:22:25 +02:00
parent 7cb6621d1b
commit fc98e5aad1
3 changed files with 55 additions and 19 deletions
@@ -41,3 +41,11 @@ spring.output.ansi.enabled=ALWAYS
# Öffentliche Basis-URL, z. B. für künftig erzeugte absolute Links.
mindflux.public-url=${MINDFLUX_PUBLIC_URL:http://localhost:8282}
# =======================
# Datei-Uploads (Profilbilder)
# =======================
# Hinweis: Der nginx-Reverse-Proxy muss client_max_body_size passend gesetzt haben,
# sonst greift schon dort ein 413, bevor die App den Upload sieht.
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB