mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-28 18:46:09 +00:00
web/headers: add more stuff to CSP again
This commit is contained in:
parent
732199332e
commit
9024418aff
|
@ -1,5 +1,11 @@
|
||||||
import env from "$lib/env";
|
import env from "$lib/env";
|
||||||
|
|
||||||
|
const allowedScriptOrigins = [
|
||||||
|
"'self'",
|
||||||
|
"challenges.cloudflare.com",
|
||||||
|
env.PLAUSIBLE_HOST ? env.PLAUSIBLE_HOST : ""
|
||||||
|
]
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
const CSP = {
|
const CSP = {
|
||||||
"connect-src": ["*"],
|
"connect-src": ["*"],
|
||||||
|
@ -7,15 +13,14 @@ export async function GET() {
|
||||||
|
|
||||||
"font-src": ["'self'"],
|
"font-src": ["'self'"],
|
||||||
"style-src": ["'self'"],
|
"style-src": ["'self'"],
|
||||||
"img-src": ["'self'"],
|
"style-src-attr": ["'self'"],
|
||||||
|
"style-src-elem": ["'self'"],
|
||||||
|
"img-src": ["'self'", "data:"],
|
||||||
"manifest-src": ["'self'"],
|
"manifest-src": ["'self'"],
|
||||||
"worker-src": ["'self'"],
|
"worker-src": ["'self'"],
|
||||||
|
|
||||||
"script-src": [
|
"script-src": allowedScriptOrigins,
|
||||||
"'self'",
|
"script-src-attr": allowedScriptOrigins,
|
||||||
"challenges.cloudflare.com",
|
|
||||||
env.PLAUSIBLE_HOST ? env.PLAUSIBLE_HOST : ""
|
|
||||||
],
|
|
||||||
"frame-src": ["challenges.cloudflare.com"],
|
"frame-src": ["challenges.cloudflare.com"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue