From b25342dd51e3a846111f0eb1f7e987a9284e798d Mon Sep 17 00:00:00 2001 From: Thomas Rijpstra Date: Tue, 18 Jul 2023 12:31:00 +0200 Subject: [PATCH] fix(nonce): set nonce value when using ssg --- src/runtime/nitro/plugins/cspNonce.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runtime/nitro/plugins/cspNonce.ts b/src/runtime/nitro/plugins/cspNonce.ts index 0f8189b4..4eedea42 100644 --- a/src/runtime/nitro/plugins/cspNonce.ts +++ b/src/runtime/nitro/plugins/cspNonce.ts @@ -27,6 +27,12 @@ export default function (nitro) { if (!nonce) { return } + // Replace nonce attribute in http-equiv meta tag + html.head = html.head.map((meta) => { + if (!meta.startsWith(' link.replaceAll(tagNotPrecededByQuotes('link'), ` link.replaceAll(tagNotPrecededByQuotes('link'), `