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>
This commit is contained in:
@@ -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 ''
|
||||
|
||||
Reference in New Issue
Block a user