From addc88f96fb4b873d66ea32df433e98be741d7c7 Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Wed, 10 Jan 2018 17:25:05 +0100 Subject: Create a getHostUrl function in the urls helper --- server/sonar-web/src/main/js/helpers/urls.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/sonar-web/src/main/js/helpers') diff --git a/server/sonar-web/src/main/js/helpers/urls.ts b/server/sonar-web/src/main/js/helpers/urls.ts index be7d4b660dc..51666283ff8 100644 --- a/server/sonar-web/src/main/js/helpers/urls.ts +++ b/server/sonar-web/src/main/js/helpers/urls.ts @@ -36,6 +36,10 @@ export function getBaseUrl(): string { return (window as any).baseUrl; } +export function getHostUrl(): string { + return window.location.origin + getBaseUrl(); +} + export function getPathUrlAsString(path: Location): string { return `${getBaseUrl()}${path.pathname}?${stringify(omitBy(path.query, isNil))}`; } -- cgit v1.2.3