Skip to content

Commit

Permalink
Correction of badges url in self-hosting configuration with a custom …
Browse files Browse the repository at this point in the history
…port. Issue 7025 (#7036)

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
  • Loading branch information
cnico and repo-ranger[bot] authored Sep 25, 2021
1 parent 1681384 commit 1f94f8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
Expand Down

0 comments on commit 1f94f8d

Please # to comment.