fix: request module URL computation improvements

This commit is contained in:
janishutz committed 2026-09-22 17:37:16 +02:00
1 parent 781d03a029
commit 1cccd1619f
1 file changed
+6 -3
+6 -3
View File
@@ -59,11 +59,14 @@ export const deleteRequest = async ( url: string, authErrorResolution?: AuthErro
* @returns The URL to the backend * @returns The URL to the backend
*/ */
export const getBackendURL = () => { export const getBackendURL = () => {
return config.get().backendURL; return new URL( config.get().backendURL.toString() );
}; };
const wrapper = async ( url: string, opts: RequestInit, authErrorResolution?: AuthErrorResolution ): Promise<Response> => { const wrapper = async ( path: string, opts: RequestInit, authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
const res = await fetch( config.get().backendURL + url, { const url = getBackendURL();
url.pathname = path;
const res = await fetch( url.toString(), {
'redirect': 'manual', 'redirect': 'manual',
...opts ...opts
} ); } );