aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-01-10 17:25:05 +0100
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-01-25 15:16:50 +0100
commitaddc88f96fb4b873d66ea32df433e98be741d7c7 (patch)
tree277a2e78dcf28d9a7f7ba70d385a95d2224b21b6 /server/sonar-web/src/main/js/helpers
parenta2749f6e52fbb1b46263383f0f4cf39ce5d4c418 (diff)
downloadsonarqube-addc88f96fb4b873d66ea32df433e98be741d7c7.tar.gz
sonarqube-addc88f96fb4b873d66ea32df433e98be741d7c7.zip
Create a getHostUrl function in the urls helper
Diffstat (limited to 'server/sonar-web/src/main/js/helpers')
-rw-r--r--server/sonar-web/src/main/js/helpers/urls.ts4
1 files changed, 4 insertions, 0 deletions
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))}`;
}