fix: allow unsafe-inline styles in dev CSP, suppress hydration warning on theme bootstrap script
CI / test (push) Failing after 33s
CI / test (push) Failing after 33s
This commit is contained in:
@@ -56,6 +56,7 @@ export default async function LocaleLayout({ children, params }: LocaleLayoutPro
|
|||||||
<script
|
<script
|
||||||
id="theme-bootstrap"
|
id="theme-bootstrap"
|
||||||
nonce={nonce}
|
nonce={nonce}
|
||||||
|
suppressHydrationWarning
|
||||||
dangerouslySetInnerHTML={{ __html: themeBootstrapScript }}
|
dangerouslySetInnerHTML={{ __html: themeBootstrapScript }}
|
||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export function buildContentSecurityPolicy(nonce: string, development: boolean):
|
|||||||
const directives = [
|
const directives = [
|
||||||
"default-src 'self'",
|
"default-src 'self'",
|
||||||
`script-src ${scriptSources.join(' ')}`,
|
`script-src ${scriptSources.join(' ')}`,
|
||||||
`style-src 'self' 'nonce-${nonce}'`,
|
`style-src 'self' 'nonce-${nonce}'${development ? " 'unsafe-inline'" : ''}`,
|
||||||
"img-src 'self' data: blob:",
|
"img-src 'self' data: blob:",
|
||||||
"font-src 'self' data:",
|
"font-src 'self' data:",
|
||||||
`connect-src 'self'${development ? ' ws: wss:' : ''}`,
|
`connect-src 'self'${development ? ' ws: wss:' : ''}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user