unbrick discord :sorrykirino:

This commit is contained in:
Vendicated 2025-01-24 03:25:52 +01:00
parent 5eb306f6d0
commit 6166a1c115
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -74,7 +74,7 @@ const patchCsp = (headers: Record<string, string[]>) => {
const csp = parsePolicy(headers[header][0]); const csp = parsePolicy(headers[header][0]);
const pushDirective = (directive: string, ...values: string[]) => { const pushDirective = (directive: string, ...values: string[]) => {
csp[directive] ??= []; csp[directive] ??= ["'self'"];
csp[directive].push(...values); csp[directive].push(...values);
}; };
@ -90,6 +90,7 @@ const patchCsp = (headers: Record<string, string[]>) => {
} }
} }
console.log(csp);
headers[header] = [stringifyPolicy(csp)]; headers[header] = [stringifyPolicy(csp)];
} }
}; };