mirror of https://github.com/grpc/grpc-node.git
Add error on DNS parsing failure, fix proxy DNS name
This commit is contained in:
parent
cba41bc487
commit
e73c96298f
|
@ -145,7 +145,7 @@ export function mapProxyName(
|
|||
extraOptions['grpc.http_connect_creds'] = proxyInfo.creds;
|
||||
}
|
||||
return {
|
||||
target: `dns:///${proxyInfo.address}`,
|
||||
target: `dns:${proxyInfo.address}`,
|
||||
extraOptions: extraOptions,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -171,7 +171,15 @@ class DnsResolver implements Resolver {
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (this.dnsHostname !== null) {
|
||||
if (this.dnsHostname === null) {
|
||||
setImmediate(() => {
|
||||
this.listener.onError({
|
||||
code: Status.UNAVAILABLE,
|
||||
details: `Failed to parse DNS address ${this.target}`,
|
||||
metadata: new Metadata(),
|
||||
});
|
||||
});
|
||||
} else {
|
||||
/* We clear out latestLookupResult here to ensure that it contains the
|
||||
* latest result since the last time we started resolving. That way, the
|
||||
* TXT resolution handler can use it, but only if it finishes second. We
|
||||
|
|
Loading…
Reference in New Issue