mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 09:08:54 -04:00
CSRFMiddlewareWithCORS changed CSRF handling for every route and, with a wildcard allowlist, disabled the Sec-Fetch-Site check. Restore the original CSRFMiddleware: clients that authenticate with validated header credentials, or with a single-use WebSocket ticket, are already exempt, so the motion routes need no relaxation. The motion WebSocket upgrade no longer reads the CORS allowlist to decide whether a cross-origin upgrade is acceptable. It accepts one only with a valid ticket or validated header credentials; everything else gets the same-origin default. Assisted-by: Claude Code:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>