Skip to content

Commit 5da8415

Browse files
committed
Use URL constructor instead
1 parent 1f257cb commit 5da8415

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

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

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

7274
makeRequest(urlOfInspectApi)
7375
.then(async (res) => {

0 commit comments

Comments
 (0)