From 3dd193ad73717629ae4ed7b1c62bc25955696c04 Mon Sep 17 00:00:00 2001 From: Moritz Riede Date: Wed, 8 Jan 2025 16:05:19 +0100 Subject: [PATCH] fix: parse mime type a bit more loosely --- src/actions/scenes/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/scenes/index.js b/src/actions/scenes/index.js index 2e26722..e008545 100644 --- a/src/actions/scenes/index.js +++ b/src/actions/scenes/index.js @@ -93,7 +93,7 @@ export function addSceneFromIndex(url, attribution, pipeline) { const contentType = headerResponse.headers.get('content-type'); - if (contentType === 'text/html') { + if (contentType.includes('text/html')) { const relUrl = url.endsWith('/') ? url : url.substring(0, url.lastIndexOf('/')); const response = await fetch(url, {}); const content = await response.text(); @@ -132,7 +132,7 @@ export function addSceneFromIndex(url, attribution, pipeline) { dispatch( addScene(url, bands, red, green, blue, false, hasOvr, false, attribution, usedPipeline) ); - } else if (contentType === 'image/tiff') { + } else if (contentType.includes('image/tiff')) { const tiff = await fromUrl(url); const image = await tiff.getImage();