mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
The global CSP set script-src 'self', so FastAPI's /docs page rendered blank: the inline boot <script> and the cdn.jsdelivr.net swagger-ui bundle/CSS were both blocked. /redoc and /docs/oauth2-redirect had the same problem. Branch the security_headers_middleware to emit a docs-scoped CSP for those three paths that allows cdn.jsdelivr.net (scripts + styles), the FastAPI/Redoc favicon hosts (images), and 'unsafe-inline' for the inline boot script. Every other route keeps the stricter SPA policy unchanged.