mirror of https://github.com/grpc/grpc-node.git
Fix "other" resovler registration code
This commit is contained in:
parent
1cd0ef12f2
commit
dbe98ad090
|
@ -270,7 +270,7 @@ class DnsResolver implements Resolver {
|
||||||
if (hostPort !== null) {
|
if (hostPort !== null) {
|
||||||
return hostPort.host;
|
return hostPort.host;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Failed to parse target ${target}`);
|
throw new Error(`Failed to parse target ${uriToString(target)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -401,7 +401,8 @@ describe('Name Resolver', () => {
|
||||||
|
|
||||||
it('Should return the correct authority if a different resolver has been registered', () => {
|
it('Should return the correct authority if a different resolver has been registered', () => {
|
||||||
const target = parseUri('other:name')!;
|
const target = parseUri('other:name')!;
|
||||||
resolverManager.registerResolver('other:', OtherResolver);
|
console.log(target);
|
||||||
|
resolverManager.registerResolver('other', OtherResolver);
|
||||||
|
|
||||||
const authority = resolverManager.getDefaultAuthority(target);
|
const authority = resolverManager.getDefaultAuthority(target);
|
||||||
assert.equal(authority, 'other');
|
assert.equal(authority, 'other');
|
||||||
|
|
Loading…
Reference in New Issue