From df410ebeb300faf5e8f97bafca54d6e3fe9ecda3 Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Fri, 12 Jan 2024 09:45:16 +0000 Subject: [PATCH] Add support for URL rewriting in tool specifications --- platform/src/ToolsManager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/src/ToolsManager.js b/platform/src/ToolsManager.js index 34584d1..c343e57 100644 --- a/platform/src/ToolsManager.js +++ b/platform/src/ToolsManager.js @@ -65,8 +65,12 @@ class ToolManager { } if (xhr.status === 200) { + // Rewrite URLs in tool config + let baseURL = toolUrl.url.substring(0, toolUrl.url.lastIndexOf("/")); // remove the name of the json file (including the trailing slash) + let toolConfig = xhr.responseText.replaceAll("{{BASE-URL}}", baseURL); - let validatedConfig = this.parseAndValidateToolConfig(xhr.responseText); + // Now parse tool config + let validatedConfig = this.parseAndValidateToolConfig(toolConfig); if ( validatedConfig.errors.length == 0 ){