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 Shada committed Apr 10, 2023
1 parent c0c6645 commit bdd4b45
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 bdd4b45

Please sign in to comment.