Fix: add all needed urls again

This commit is contained in:
Pieter Vander Vennet 2023-11-19 22:00:37 +01:00
parent 6b4be1200c
commit ce1855b2bd

View file

@ -280,6 +280,13 @@ async function generateCsp(
"https://pietervdvn.goatcounter.com",
].concat(...(await eliUrls()))
SpecialVisualizations.specialVisualizations.forEach(sv => {
if(typeof sv.needsUrls === "function"){
return
}
apiUrls.push(...sv.needsUrls)
})
const usedSpecialVisualisations = ValidationUtils.getSpecialVisualisationsWithArgs(layoutJson)
for (const usedSpecialVisualisation of usedSpecialVisualisations) {
if (typeof usedSpecialVisualisation === "string") {
@ -288,8 +295,6 @@ async function generateCsp(
const neededUrls = usedSpecialVisualisation.func.needsUrls
if (typeof neededUrls === "function") {
apiUrls.push(...neededUrls(usedSpecialVisualisation.args))
} else {
apiUrls.push(...neededUrls)
}
}