Skip to content

Commit

Permalink
fix(nosecone-next): Apply the correct defaults based on env (#2311)
Browse files Browse the repository at this point in the history
I mistakenly flipped the logic on these defaults—`'unsafe-eval'` needs to be set *only* in development.
  • Loading branch information
blaine-arcjet authored Nov 25, 2024
1 parent 24d2ee3 commit 2bfaa79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nosecone-next/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const defaults = {
scriptSrc:
// Replace the defaults to remove `'self'`
process.env.NODE_ENV === "development"
? ([nonce, "'strict-dynamic'"] as const)
: // Next.js hot reloading relies on `eval` so we enable it in development
([nonce, "'strict-dynamic'", "'unsafe-eval'"] as const),
? // Next.js hot reloading relies on `eval` so we enable it in development
([nonce, "'strict-dynamic'", "'unsafe-eval'"] as const)
: ([nonce, "'strict-dynamic'"] as const),
styleSrc: [
...baseDefaults.contentSecurityPolicy.directives.styleSrc,
"'unsafe-inline'",
Expand Down

0 comments on commit 2bfaa79

Please sign in to comment.