Skip to content

Commit fc65f1a

Browse files
authored
Add Base URI to Inspect API calls (#3190)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
1 parent b066b6a commit fc65f1a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

web-app/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/InspectObject.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ const InspectObject = ({
6666
const file = encodeURLString(inspectPath + "/xl.meta");
6767
const volume = encodeURLString(volumeName);
6868

69-
const urlOfInspectApi = `/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`;
69+
let basename = document.baseURI.replace(window.location.origin, "");
70+
const urlOfInspectApi = `${basename}/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`;
7071

7172
makeRequest(urlOfInspectApi)
7273
.then(async (res) => {

web-app/src/screens/Console/Tools/Inspect.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ const Inspect = () => {
146146
const file = encodeURLString(inspectPath);
147147
const volume = encodeURLString(volumeName);
148148

149-
const urlOfInspectApi = `/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`;
149+
let basename = document.baseURI.replace(window.location.origin, "");
150+
const urlOfInspectApi = `${basename}/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`;
150151

151152
makeRequest(urlOfInspectApi)
152153
.then(async (res) => {

0 commit comments

Comments
 (0)