Skip to content

Commit

Permalink
- Fixed DNS Checker
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidArayan committed Feb 14, 2024
1 parent e0b3bb6 commit cec145b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk-core/src/core/util/dns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ export class DNS {

// otherwise, recheck and re-cache
import('dns').then((dns) => {
dns.lookup(hostname, (error) => {
const url: URL = new URL(hostname);
dns.lookup(url.hostname, (error) => {
const status: boolean = (error ? false : true);

DNS._DNSCache.set(hostname, { status: status });

accept(status);
});
}).catch(() => {
}).catch((err) => {
console.error("DNS.check - " + err);
DNS._DNSCache.set(hostname, { status: false });

accept(false);
Expand Down

0 comments on commit cec145b

Please sign in to comment.