Fix capture group numbers in parseTarget

This commit is contained in:
Michael Lumish 2020-01-28 15:31:06 -08:00 committed by GitHub
parent 2add1c342d
commit b9220fdb2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -332,10 +332,10 @@ export function parseTarget(target: string): dnsUrl | null {
const match = IPV4_REGEX.exec(target) ?? IPV6_REGEX.exec(target) ?? IPV6_BRACKET_REGEX.exec(target) ?? DNS_REGEX.exec(target)
if (match) {
return {
host: match[0],
port: match[1] ?? undefined
host: match[1],
port: match[2] ?? undefined
};
} else {
return null;
}
}
}