Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set nonces for inline scripts
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 34d34f6 commit 2fc6a52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/root.tsx
Expand Up @@ -157,7 +157,7 @@ function getMarkup(
<div className="App">
<Navigation {...loaderData} />
{children}
<Scripts />
<Scripts nonce={loaderData.nonce} />
</div>
</ChakraProvider>
</StrictMode>
Expand Down
2 changes: 1 addition & 1 deletion functions/_middleware.ts
Expand Up @@ -106,7 +106,7 @@ async function setHeaders(context: RequestContext) {

response.headers.set(
"Content-Security-Policy",
`connect-src https://o1071757.ingest.sentry.io https://storage.googleapis.com 'self'; default-src 'self'; frame-src https://challenges.cloudflare.com; img-src https://cdn.discordapp.com https://mediaproxy.carcrushers.cc 'self'; media-src https://mediaproxy.carcrushers.cc; report-uri https://o1071757.ingest.sentry.io/api/6069431/security/?sentry_key=3d2b34700e6942f9b739cd8b2001f70f; script-src https://challenges.cloudflare.com 'self'; style-src nonce-${nonce} 'self'`,
`connect-src https://o1071757.ingest.sentry.io https://storage.googleapis.com 'self'; default-src 'self'; frame-src https://challenges.cloudflare.com; img-src https://cdn.discordapp.com https://mediaproxy.carcrushers.cc 'self'; media-src https://mediaproxy.carcrushers.cc; report-uri https://o1071757.ingest.sentry.io/api/6069431/security/?sentry_key=3d2b34700e6942f9b739cd8b2001f70f; script-src https://challenges.cloudflare.com nonce-${nonce} 'self'; style-src nonce-${nonce} 'self'`,
);
response.headers.set("Permissions-Policy", "clipboard-write=(self)");
response.headers.set("Referrer-Policy", "same-origin");
Expand Down

0 comments on commit 2fc6a52

Please sign in to comment.