*Resolvers getter may be a promise

This commit is contained in:
Derrick Hammer 2022-08-19 09:49:02 -04:00
parent cc2a8668ab
commit 74f60ea59a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 1 deletions

View File

@ -26,7 +26,12 @@ interface HnsRecord {
export default class Handshake extends AbstractResolverModule { export default class Handshake extends AbstractResolverModule {
private async buildBlacklist(): Promise<Set<string>> { private async buildBlacklist(): Promise<Set<string>> {
const blacklist = new Set<string>(); const blacklist = new Set<string>();
for (const resolver of this.resolver.resolvers) { let resolvers = this.resolver.resolvers;
if (isPromise(resolvers as any)) {
resolvers = await resolvers;
}
for (const resolver of resolvers) {
let tlds = resolver.getSupportedTlds(); let tlds = resolver.getSupportedTlds();
if (isPromise(tlds as any)) { if (isPromise(tlds as any)) {
tlds = await tlds; tlds = await tlds;