From e557a244a1a5e3eca37a630f9bb15e18c5912e7c Mon Sep 17 00:00:00 2001 From: Dave Buchhofer Date: Mon, 14 Mar 2022 10:47:14 -0400 Subject: [PATCH] [three] - workaround path trailing slash assumption in LoaderUtil --- src/three/GLTFExtensionLoader.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/three/GLTFExtensionLoader.js b/src/three/GLTFExtensionLoader.js index d994aadfd..4f54f0e94 100644 --- a/src/three/GLTFExtensionLoader.js +++ b/src/three/GLTFExtensionLoader.js @@ -45,7 +45,12 @@ export class GLTFExtensionLoader extends LoaderBase { // assume any pre-registered loader has paths configured as the user desires, but if we're making // a new loader, use the working path during parse to support relative uris on other hosts - const resourcePath = loader.resourcePath || loader.path || this.workingPath; + let resourcePath = loader.resourcePath || loader.path || this.workingPath; + if ( ! /[\\/]$/.test( resourcePath ) ) { + + resourcePath += '/'; + + } loader.parse( buffer, resourcePath, model => {