Skip to content
Snippets Groups Projects
Commit 288efa21 authored by netpro2k's avatar netpro2k
Browse files

Fix for loading farspark-whitelisted urls

parent 8c4a8120
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ const staticContentMappings = { ...@@ -28,7 +28,7 @@ const staticContentMappings = {
"poly.googleapis.com": "model/gltf" "poly.googleapis.com": "model/gltf"
}; };
const fetchContentType = async url => { const fetchContentType = async url => {
const staticContentType = staticContentMappings[new URL(decodeFarsparkUrl(url)).hostname]; const staticContentType = staticContentMappings[new URL(isFarsparkUrl(url) ? decodeFarsparkUrl(url) : url).hostname];
return staticContentType return staticContentType
? Promise.resolve(staticContentType) ? Promise.resolve(staticContentType)
: fetch(url, { method: "HEAD" }).then(r => r.headers.get("content-type")); : fetch(url, { method: "HEAD" }).then(r => r.headers.get("content-type"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment