Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Correction of badges url in self-hosting configuration with a custom port #7036

Merged
merged 3 commits into from
Sep 25, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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