From 1f94f8d5711396203ffe82e83497d7f84ffa556d Mon Sep 17 00:00:00 2001 From: cnico Date: Sat, 25 Sep 2021 05:19:44 +0200 Subject: [PATCH] Correction of badges url in self-hosting configuration with a custom port. Issue 7025 (#7036) Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> --- frontend/constants.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/constants.ts b/frontend/constants.ts index 20785f90db4f2..a50ba5e4a6da9 100644 --- a/frontend/constants.ts +++ b/frontend/constants.ts @@ -21,11 +21,11 @@ export function getBaseUrl(): string { https://img.shields.io/ */ try { - const { protocol, hostname } = window.location + const { protocol, hostname, port } = window.location if (['shields.io', 'www.shields.io'].includes(hostname)) { return 'https://img.shields.io' } - return `${protocol}//${hostname}` + return `${protocol}//${hostname}:${port}` } catch (e) { // server-side rendering return ''