Fix: fix loading images for CSP, fix #2161

This commit is contained in:
Pieter Vander Vennet 2024-09-18 23:07:26 +02:00
parent 349c6538a0
commit 2569d0cb66
3 changed files with 5 additions and 4 deletions

View file

@ -12,7 +12,7 @@ export class Imgur extends ImageProvider implements ImageUploader {
public readonly defaultKeyPrefixes: string[] = ["image"]
public readonly maxFileSizeInMegabytes = 10
public static readonly apiUrl = "https://api.imgur.com/3/image"
public static readonly supportingUrls = ["https://i.imgur.com"]
private constructor() {
super()
}

View file

@ -9,6 +9,7 @@ import { Utils } from "../../Utils"
import { Point } from "geojson"
import MvtSource from "../FeatureSource/Sources/MvtSource"
import AllImageProviders from "../ImageProviders/AllImageProviders"
import { Imgur } from "../ImageProviders/Imgur"
interface ImageFetcher {
/**
@ -353,7 +354,7 @@ type P4CService = (typeof P4CImageFetcher.services)[number]
export class CombinedFetcher {
private readonly sources: ReadonlyArray<CachedFetcher>
public static apiUrls = P4CImageFetcher.apiUrls
public static apiUrls = [...P4CImageFetcher.apiUrls, Imgur.apiUrl, ...Imgur.supportingUrls]
constructor(radius: number, maxage: Date, indexedFeatures: IndexedFeatureSource) {
this.sources = [