Skip to content

Commit dc1cd40

Browse files
jisqyvShada
authored andcommitted
fix: use correct basepath prefix for preview urls (filebrowser#1971)
1 parent 7b95c60 commit dc1cd40

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/src/api/utils.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ export function removePrefix(url) {
6262
}
6363

6464
export function createURL(endpoint, params = {}, auth = true) {
65-
const url = new URL(encodePath(endpoint), origin + baseURL);
65+
let prefix = baseURL;
66+
if (prefix[prefix.length] !== "/") {
67+
prefix = prefix + "/";
68+
}
69+
const url = new URL(prefix + encodePath(endpoint), origin);
6670

6771
const searchParams = {
6872
...(auth && { auth: store.state.jwt }),

0 commit comments

Comments
 (0)