From a2e1c1d012d74c9f4cc91d8d7aa5e73a2d060ece Mon Sep 17 00:00:00 2001 From: Nicolas Cazottes Date: Sun, 19 Sep 2021 13:10:09 +0200 Subject: [PATCH] Correction of badges url in self-hosting configuration with a custom port. Issue 7025 --- 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 ''