diff --git a/frontend/src/utils/URL.ts b/frontend/src/utils/URL.ts index b662c9e..b38c124 100644 --- a/frontend/src/utils/URL.ts +++ b/frontend/src/utils/URL.ts @@ -28,7 +28,11 @@ export const getFromQuery = ({ export const buildURL = (baseUrl: string, relativePath: string): string => { try { - const url = new URL(relativePath, baseUrl); + const normalizedBaseUrl = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`; + const normalizedRelativePath = relativePath.startsWith("/") + ? relativePath.slice(1) + : relativePath; + const url = new URL(normalizedRelativePath, normalizedBaseUrl); return url.toString(); } catch {