mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
fix(docs): exclude /docs from CSP that blocks Mintlify (#1750)
* fix(docs): exclude /docs from CSP header that blocks Mintlify scripts The catch-all /(.*) header rule applied Content-Security-Policy with SHA-based script-src to all routes including /docs/*. Mintlify generates dozens of inline scripts that don't match those hashes, causing 71 CSP errors and a completely blank docs page. Fix: change catch-all to /((?!docs).*) so /docs paths inherit only their own lightweight headers (nosniff, HSTS, referrer-policy). * fix(tests): update deploy-config test for docs CSP exclusion Test was looking for exact source '/(.*)', updated to match the new '/((?!docs).*)' pattern that excludes /docs from the strict CSP.
This commit is contained in:
@@ -63,7 +63,7 @@ describe('deploy/cache configuration guardrails', () => {
|
||||
});
|
||||
|
||||
const getSecurityHeaders = () => {
|
||||
const rule = vercelConfig.headers.find((entry) => entry.source === '/(.*)');
|
||||
const rule = vercelConfig.headers.find((entry) => entry.source === '/((?!docs).*)');
|
||||
return rule?.headers ?? [];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user