From 4f38dd6b08746a766f1dfdd2d4eac3bce2d9146c Mon Sep 17 00:00:00 2001 From: Michiel Lankamp Date: Thu, 14 Nov 2024 11:18:35 +0100 Subject: [PATCH] Fix when manifextSrc contains a Shared Access Key --- src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js b/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js index 2597fa8869..62c8de4903 100644 --- a/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +++ b/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js @@ -427,7 +427,7 @@ parsers[ParserV11.version] = ParserV11; * * ````javascript * const sceneModel = xktLoader.load({ - * manifestSrc: "https://xeokit.github.io/xeokit-sdk/assets/models/models/xkt/Schependomlaan.xkt", + * src: "https://xeokit.github.io/xeokit-sdk/assets/models/models/xkt/Schependomlaan.xkt", * id: "myModel", * }); * ```` @@ -1165,6 +1165,10 @@ class XKTLoaderPlugin extends Plugin { } function getBaseDirectory(filePath) { + if (filePath.indexOf('?') > -1) { + filePath = filePath.split('?')[0]; + } + const pathArray = filePath.split('/'); pathArray.pop(); // Remove the file name or the last segment of the path return pathArray.join('/') + '/';