mirror of https://github.com/grpc/grpc-node.git
Fix capture group numbers in parseTarget
This commit is contained in:
parent
2add1c342d
commit
b9220fdb2d
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue