Skip to content

Commit 10b6888

Browse files
authored
fix: Corrected non-default port extraction for self-hosted gitlab (#209)
1 parent 9e19184 commit 10b6888

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/urlDecoder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export function extractUrlDomain(input: string): string | null {
22
try {
33
const normalizedInput = input.startsWith('http') ? input : `https://${input}`;
44
const url = new URL(normalizedInput);
5-
return `${url.protocol}//${url.hostname}`; // Inclut le protocole et le domaine
5+
return `${url.protocol}//${url.hostname}${url.port ? ':' + url.port : ''}`; // Inclut le protocole et le domaine
66
} catch {
77
return null; // Not a valid URL
88
}

0 commit comments

Comments
 (0)