Skip to content

Commit

Permalink
fix: use correct basepath prefix for preview urls (filebrowser#1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
jisqyv authored and Rahul committed Sep 2, 2022
1 parent 387eb3f commit 788602e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/api/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ export function removePrefix(url) {
}

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

const searchParams = {
...(auth && { auth: store.state.jwt }),
Expand Down

0 comments on commit 788602e

Please sign in to comment.