fix(web): nonce Google tag loader
This commit is contained in:
@@ -46,7 +46,7 @@ function contentSecurityPolicy(nonce: string): string {
|
|||||||
const mediaOrigin = new URL(STRAPI_URL).origin;
|
const mediaOrigin = new URL(STRAPI_URL).origin;
|
||||||
const directives = [
|
const directives = [
|
||||||
"default-src 'self'",
|
"default-src 'self'",
|
||||||
`script-src 'self' 'nonce-${nonce}' https://www.googletagmanager.com`,
|
`script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https://www.googletagmanager.com`,
|
||||||
"script-src-attr 'none'",
|
"script-src-attr 'none'",
|
||||||
"style-src 'self' 'unsafe-inline'",
|
"style-src 'self' 'unsafe-inline'",
|
||||||
`img-src 'self' ${mediaOrigin} https://www.google-analytics.com data: blob:`,
|
`img-src 'self' ${mediaOrigin} https://www.google-analytics.com data: blob:`,
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ export function Layout({ children }: { children: ReactNode }) {
|
|||||||
<Meta />
|
<Meta />
|
||||||
<Links />
|
<Links />
|
||||||
<script
|
<script
|
||||||
|
nonce={nonce}
|
||||||
async
|
async
|
||||||
src="https://www.googletagmanager.com/gtag/js?id=G-TJT6NM2DMT"
|
src="https://www.googletagmanager.com/gtag/js?id=G-TJT6NM2DMT"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user