Fix "other" resovler registration code

This commit is contained in:
Michael Lumish 2020-04-16 08:34:24 -07:00
parent 1cd0ef12f2
commit dbe98ad090
2 changed files with 3 additions and 2 deletions

View File

@ -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)}`);
} }
} }
} }

View File

@ -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');