Allow cdn.jsdelivr.net in CSP for Swagger UI API docs page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
6
proxy.ts
6
proxy.ts
@@ -21,10 +21,10 @@ function buildCsp(nonce: string): string {
|
||||
const directives = [
|
||||
"default-src 'self'",
|
||||
isDev
|
||||
? `script-src 'self' 'nonce-${nonce}' 'unsafe-eval'`
|
||||
: `script-src 'self' 'nonce-${nonce}'`,
|
||||
? `script-src 'self' 'nonce-${nonce}' 'unsafe-eval' https://cdn.jsdelivr.net`
|
||||
: `script-src 'self' 'nonce-${nonce}' https://cdn.jsdelivr.net`,
|
||||
// style-src still needs 'unsafe-inline' for React JSX inline style props
|
||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
|
||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.jsdelivr.net",
|
||||
"font-src 'self' https://fonts.gstatic.com",
|
||||
"img-src 'self' data: blob:",
|
||||
"worker-src blob:",
|
||||
|
||||
Reference in New Issue
Block a user