From bf7919f681d1e13d0bdb1682c2c0a71e8a7679c1 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Tue, 3 Oct 2023 13:40:21 +0200 Subject: [PATCH] csp --- layouts/partials/head/csp.html | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/layouts/partials/head/csp.html b/layouts/partials/head/csp.html index 45e1e77f..42d3080b 100644 --- a/layouts/partials/head/csp.html +++ b/layouts/partials/head/csp.html @@ -1,12 +1,13 @@ -{{- with site.Data.website.external_domains -}} -<meta http-equiv="Content-Security-Policy" - content="default-src 'self' - {{ delimit . " " }} - {{ if not hugo.IsProduction }} - 'unsafe-inline' - {{ end }} - {{ if site.Params.search.active }} - 'wasm-unsafe-eval' 'unsafe-eval' - {{ end }}; - " /> +{{ if not site.Params.search.active }} + {{- with site.Data.website.external_domains -}} + <meta http-equiv="Content-Security-Policy" + content="default-src 'self' + {{ delimit . " " }} + {{ if not hugo.IsProduction }} + 'unsafe-inline' + {{ end }} + {{ if site.Params.search.active }} + 'wasm-unsafe-eval' + {{ end }};" /> + {{- end -}} {{- end -}} -- GitLab