Skip to content

Commit

Permalink
fix: falsy values for SSG CSP
Browse files Browse the repository at this point in the history
  • Loading branch information
Baroshem committed Sep 26, 2023
1 parent 29766f0 commit bf5d18e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"dev:start": "nuxi start playground",
"dev:generate": "nuxi generate playground",
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"dev:preview": "nuxi preview playground",
"lint": "eslint --ext .js,.ts,.vue",
"test": "vitest run --silent",
"test:watch": "vitest watch",
"docs": "cd docs && yarn dev",
"preview": "nuxi preview playground",
"stackblitz": "cd .stackblitz && yarn && yarn dev"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default defineNuxtConfig({
xXSSProtection: '0'
},
rateLimiter: {
tokensPerInterval: 3
tokensPerInterval: 10
}
}
})
4 changes: 3 additions & 1 deletion src/runtime/nitro/plugins/02-cspSsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export default <NitroAppPlugin> function (nitro) {
policyValue = value
}

contentArray.push(`${key} ${policyValue}`)
if (value !== false) {
contentArray.push(`${key} ${policyValue}`)
}
}
const content = contentArray.join('; ')

Expand Down

0 comments on commit bf5d18e

Please sign in to comment.