diff --git a/src/runtime/nitro/plugins/04-cspSsgHashes.ts b/src/runtime/nitro/plugins/04-cspSsgHashes.ts index 61350d06..7ecf8b00 100644 --- a/src/runtime/nitro/plugins/04-cspSsgHashes.ts +++ b/src/runtime/nitro/plugins/04-cspSsgHashes.ts @@ -102,8 +102,9 @@ export default defineNitroPlugin((nitroApp) => { const csp = security.headers.contentSecurityPolicy const headerValue = generateCspRules(csp, scriptHashes, styleHashes) // Insert CSP in the http meta tag if meta is true + if (security.ssg && security.ssg.meta) { - cheerios.head.push(cheerio.load(``)) + cheerios.head.push(cheerio.load(``, null, false)) } // Update rules in HTTP header setResponseHeader(event, 'Content-Security-Policy', headerValue)