Skip to content

Commit

Permalink
Merge pull request #32 from DeBuXer/querycaa_fix
Browse files Browse the repository at this point in the history
Fix for queryCaa ENODATA when using local DNS
  • Loading branch information
willnode authored Sep 18, 2024
2 parents 1d2d088 + acfac13 commit e98137a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,9 @@ export async function validateCAARecords(host, mockResolve = undefined) {
}
let issueRecords;
if (useLocalDNS && !mockResolve) {
const records = await dns.resolveCaa(host);
if (!records || records.length === 0) {
return null;
}
const records = mockResolve || await dns.resolveCaa(host).catch(() => null);
issueRecords = (records || []).filter(record => record.issue).map(record => `0 issue "${record.issue}"`);

issueRecords = records.filter(record => record.issue).map(record => `0 issue "${record.issue}"`)
} else {
/**
* @type {{data: {Answer: {data: string, type: number}[]}}}
Expand Down

0 comments on commit e98137a

Please sign in to comment.