forked from MapComplete/MapComplete
		
	Fix: add all needed urls again
This commit is contained in:
		
							parent
							
								
									6b4be1200c
								
							
						
					
					
						commit
						ce1855b2bd
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		|  | @ -280,6 +280,13 @@ async function generateCsp( | ||||||
|         "https://pietervdvn.goatcounter.com", |         "https://pietervdvn.goatcounter.com", | ||||||
|     ].concat(...(await eliUrls())) |     ].concat(...(await eliUrls())) | ||||||
| 
 | 
 | ||||||
|  |     SpecialVisualizations.specialVisualizations.forEach(sv => { | ||||||
|  |         if(typeof sv.needsUrls === "function"){ | ||||||
|  |             return | ||||||
|  |         } | ||||||
|  |         apiUrls.push(...sv.needsUrls) | ||||||
|  |     }) | ||||||
|  | 
 | ||||||
|     const usedSpecialVisualisations = ValidationUtils.getSpecialVisualisationsWithArgs(layoutJson) |     const usedSpecialVisualisations = ValidationUtils.getSpecialVisualisationsWithArgs(layoutJson) | ||||||
|     for (const usedSpecialVisualisation of usedSpecialVisualisations) { |     for (const usedSpecialVisualisation of usedSpecialVisualisations) { | ||||||
|         if (typeof usedSpecialVisualisation === "string") { |         if (typeof usedSpecialVisualisation === "string") { | ||||||
|  | @ -288,8 +295,6 @@ async function generateCsp( | ||||||
|         const neededUrls = usedSpecialVisualisation.func.needsUrls |         const neededUrls = usedSpecialVisualisation.func.needsUrls | ||||||
|         if (typeof neededUrls === "function") { |         if (typeof neededUrls === "function") { | ||||||
|             apiUrls.push(...neededUrls(usedSpecialVisualisation.args)) |             apiUrls.push(...neededUrls(usedSpecialVisualisation.args)) | ||||||
|         } else { |  | ||||||
|             apiUrls.push(...neededUrls) |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue