Comparing version 1.2.0 to 1.2.1
@@ -29,5 +29,3 @@ "use strict"; | ||
// resolve a CAA record, possibly via recursion | ||
const resolve = async ({name, socket, server, port}) => { | ||
const query = util.promisify(socket.query.bind(socket)); | ||
const resolve = async ({name, query, server, port}) => { | ||
const [cname, dname, caa] = await Promise.all([ | ||
@@ -61,3 +59,3 @@ query({questions: [{name, type: "CNAME"}]}, port, server).then(parseAnswers).catch(noop), | ||
const parent = parts.splice(1).join("."); | ||
return await resolve({name: parent, socket, server, port}); | ||
return await resolve({name: parent, query, server, port}); | ||
} else { | ||
@@ -83,4 +81,5 @@ return []; | ||
const socket = dnsSocket(); | ||
const query = util.promisify(socket.query.bind(socket)); | ||
const port = opts.port || 53; | ||
const caa = await resolve({name, socket, server, port}); | ||
const caa = await resolve({name, query, server, port}); | ||
socket.destroy(); | ||
@@ -87,0 +86,0 @@ return caa || []; |
{ | ||
"name": "caa", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "rfc6844-conform CAA record lookup", | ||
@@ -5,0 +5,0 @@ "author": "silverwind <me@silverwind.io>", |
@@ -17,6 +17,6 @@ # caa | ||
console.log(await caa('subdomain.example.com')); | ||
caa('subdomain.example.com').then(console.log); | ||
// => [{flags: 0, tag: 'issue', tag: 'issue', value: 'letsencrypt.org', issuerCritical: false}] | ||
console.log(await caa.matches('subdomain.example.com', 'letsencrypt.org')); | ||
caa.matches('subdomain.example.com', 'letsencrypt.org').then(console.log); | ||
// => true | ||
@@ -23,0 +23,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5834