aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/urls.ts
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2018-12-24 12:35:10 +0100
committerSonarTech <sonartech@sonarsource.com>2018-12-26 20:20:58 +0100
commitea6102e599b37a73cce37675bff9456338c1f75f (patch)
tree42092c04ebe4f44c8cd646477f5a40ddc34ab9b9 /server/sonar-web/src/main/js/helpers/urls.ts
parenta9fd4eb48b2ae984bdcac4e2e8ebdd16d5ac3a76 (diff)
downloadsonarqube-ea6102e599b37a73cce37675bff9456338c1f75f.tar.gz
sonarqube-ea6102e599b37a73cce37675bff9456338c1f75f.zip
SONAR-10649 Add Markdown format for badges
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/urls.ts')
-rw-r--r--server/sonar-web/src/main/js/helpers/urls.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/helpers/urls.ts b/server/sonar-web/src/main/js/helpers/urls.ts
index c8c7db886a5..ff94ab0fee8 100644
--- a/server/sonar-web/src/main/js/helpers/urls.ts
+++ b/server/sonar-web/src/main/js/helpers/urls.ts
@@ -44,8 +44,10 @@ export function getHostUrl(): string {
return window.location.origin + getBaseUrl();
}
-export function getPathUrlAsString(path: Location): string {
- return `${getBaseUrl()}${path.pathname}?${stringify(omitBy(path.query, isNil))}`;
+export function getPathUrlAsString(path: Location, internal = true): string {
+ return `${internal ? getBaseUrl() : getHostUrl()}${path.pathname}?${stringify(
+ omitBy(path.query, isNil)
+ )}`;
}
export function getProjectUrl(project: string, branch?: string): Location {