From 0d7c3dcf8ad2d0ad4e2c2f1acb970559cb4ca859 Mon Sep 17 00:00:00 2001 From: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> Date: Tue, 16 Jan 2024 10:48:08 -0800 Subject: [PATCH] Add Base URI to Inspect API calls Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> --- .../Buckets/ListBuckets/Objects/ListObjects/InspectObject.tsx | 3 ++- web-app/src/screens/Console/Tools/Inspect.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web-app/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/InspectObject.tsx b/web-app/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/InspectObject.tsx index ec9ccd77d4..6dad481402 100644 --- a/web-app/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/InspectObject.tsx +++ b/web-app/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/InspectObject.tsx @@ -66,7 +66,8 @@ const InspectObject = ({ const file = encodeURLString(inspectPath + "/xl.meta"); const volume = encodeURLString(volumeName); - const urlOfInspectApi = `/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`; + let basename = document.baseURI.replace(window.location.origin, ""); + const urlOfInspectApi = `${basename}/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`; makeRequest(urlOfInspectApi) .then(async (res) => { diff --git a/web-app/src/screens/Console/Tools/Inspect.tsx b/web-app/src/screens/Console/Tools/Inspect.tsx index 25c0fee142..2bd2b4f1bc 100644 --- a/web-app/src/screens/Console/Tools/Inspect.tsx +++ b/web-app/src/screens/Console/Tools/Inspect.tsx @@ -146,7 +146,8 @@ const Inspect = () => { const file = encodeURLString(inspectPath); const volume = encodeURLString(volumeName); - const urlOfInspectApi = `/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`; + let basename = document.baseURI.replace(window.location.origin, ""); + const urlOfInspectApi = `${basename}/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`; makeRequest(urlOfInspectApi) .then(async (res) => {