fix: preview url building fix (#1976)

pull/1973/head^2
Po Chen 2022-06-10 20:05:05 +10:00 committed by GitHub
parent c211b96719
commit dcf0bc65bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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