From fcdc92e18cbe3adf2bf76f30ff15b9866ba6fa5f Mon Sep 17 00:00:00 2001 From: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:45:27 -0800 Subject: [PATCH] Add Base URI to Inspect API calls (#3190) 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) => {