make intent clearer

This commit is contained in:
Vendicated 2025-04-08 02:04:19 +02:00
parent 694c31f28f
commit ffd1bd2d6a
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -86,7 +86,7 @@ const patchCsp = (headers: Record<string, string[]>) => {
const csp = parsePolicy(headers[header][0]);
const pushDirective = (directive: string, ...values: string[]) => {
csp[directive] ??= [...csp["default-src"] ?? []];
csp[directive] ??= [...(csp["default-src"] ?? [])];
csp[directive].push(...values);
};