web/headers: add more stuff to CSP again

This commit is contained in:
wukko 2024-09-18 19:12:13 +06:00
parent 732199332e
commit 9024418aff
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -1,5 +1,11 @@
import env from "$lib/env";
const allowedScriptOrigins = [
"'self'",
"challenges.cloudflare.com",
env.PLAUSIBLE_HOST ? env.PLAUSIBLE_HOST : ""
]
export async function GET() {
const CSP = {
"connect-src": ["*"],
@ -7,15 +13,14 @@ export async function GET() {
"font-src": ["'self'"],
"style-src": ["'self'"],
"img-src": ["'self'"],
"style-src-attr": ["'self'"],
"style-src-elem": ["'self'"],
"img-src": ["'self'", "data:"],
"manifest-src": ["'self'"],
"worker-src": ["'self'"],
"script-src": [
"'self'",
"challenges.cloudflare.com",
env.PLAUSIBLE_HOST ? env.PLAUSIBLE_HOST : ""
],
"script-src": allowedScriptOrigins,
"script-src-attr": allowedScriptOrigins,
"frame-src": ["challenges.cloudflare.com"],
}