GenerAI / worldmonitor /src /utils /imagery-preview.ts
amogaddy's picture
Integra World Monitor (AGPL-3.0, self-hosted) nello Space: pagina, menu, e arricchimento notizie per la AI (part 8)
dbb1bf9 verified
Raw
History Blame Contribute Delete
424 Bytes
const IMAGERY_PREVIEW_HOSTS = [
'sentinel-s1-l1c.s3.amazonaws.com',
'sentinel-cogs.s3.us-west-2.amazonaws.com',
'earth-search.aws.element84.com',
];
export function isAllowedPreviewUrl(url: string | undefined): boolean {
if (!url) return false;
try {
const parsed = new URL(url);
return parsed.protocol === 'https:' && IMAGERY_PREVIEW_HOSTS.some(h => parsed.hostname === h);
} catch { return false; }
}