Skip to content

Commit

Permalink
fix: parse mime type a bit more loosely
Browse files Browse the repository at this point in the history
  • Loading branch information
spectrachrome committed Jan 8, 2025
1 parent bff9875 commit 3dd193a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/actions/scenes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 3dd193a

Please sign in to comment.