-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stanislav Lysak
committed
Aug 11, 2024
1 parent
20cc129
commit cbc5c21
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Helmet } from "react-helmet"; | ||
|
||
const resources = [ | ||
"https://*.googletagmanager.com", | ||
"plausible.io", | ||
"static.cloudflareinsights.com", | ||
"*.ens-app-v3.pages.dev", | ||
"https://app.intercom.io", | ||
"https://widget.intercom.io", | ||
"https://js.intercomcdn.com", | ||
].join(" "); | ||
|
||
const content = | ||
process.env.NODE_ENV === "production" | ||
? `worker-src 'self'; script-src 'self' 'sha256-UyYcl+sKCF/ROFZPHBlozJrndwfNiC5KT5ZZfup/pPc=' ${resources} 'wasm-unsafe-eval';` | ||
: "script-src 'self'"; | ||
|
||
export function Csp() { | ||
return ( | ||
<Helmet> | ||
<meta httpEquiv="Content-Security-Policy" content={content} /> | ||
</Helmet> | ||
); | ||
} |