Skip to content

Commit 4b220ec

Browse files
committed
Fix loaders' working path creation - Resolves #1282
1 parent fa1f52e commit 4b220ec

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/core/renderer/loaders/I3DMLoaderBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class I3DMLoaderBase extends LoaderBase {
9090
//Store the gltf working path
9191
const uriSplits = externalUri.split( /[\\/]/g );
9292
uriSplits.pop();
93-
gltfWorkingPath = uriSplits.join( '/' );
93+
gltfWorkingPath = uriSplits.join( '/' ) + '/';
9494

9595
promise = fetch( externalUri, this.fetchOptions )
9696
.then( res => {

src/core/renderer/loaders/LoaderBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class LoaderBase {
4545

4646
if ( /^[^\\/]/.test( url ) && ! /^http/.test( url ) ) {
4747

48-
return this.workingPath + '/' + url;
48+
return new URL( url, this.workingPath ).href;
4949

5050
} else {
5151

src/three/renderer/tiles/TilesRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ export class TilesRenderer extends TilesRendererBase {
573573
const cached = tile.cached;
574574
const uriSplits = uri.split( /[\\/]/g );
575575
uriSplits.pop();
576-
const workingPath = uriSplits.join( '/' );
576+
const workingPath = uriSplits.join( '/' ) + '/';
577577
const fetchOptions = this.fetchOptions;
578578

579579
const manager = this.manager;

0 commit comments

Comments
 (0)