From 3bb10c87ddd9649031f62afbca4805de8aed70ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Agneray?= <francois.agneray@lam.fr> Date: Wed, 22 Sep 2021 18:31:14 +0200 Subject: [PATCH] Include base href for construct apiUrl --- client/src/app/shared/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/shared/utils.ts b/client/src/app/shared/utils.ts index b43ae07d..0e013d5c 100644 --- a/client/src/app/shared/utils.ts +++ b/client/src/app/shared/utils.ts @@ -9,7 +9,7 @@ export const getHost = (apiUrl: string): string => { if (!apiUrl.startsWith('http')) { const url = window.location; - return url.protocol + '//' + url.host + apiUrl; + return url.protocol + '//' + url.host + document.getElementsByTagName('base')[0].getAttribute('href') + apiUrl; } return apiUrl; } -- GitLab