Comparing version 1.0.0 to 1.0.1
19
index.js
"use strict"; | ||
const net = require("net"); | ||
const dnsSocket = require("dns-socket"); | ||
const socket = dnsSocket(); | ||
const resolve = ({name, server, port}) => { | ||
console.log("resolve", name); | ||
const resolve = ({name, socket, server, port}) => { | ||
return new Promise(resolve => { | ||
@@ -27,11 +24,7 @@ socket.query({questions: [{name, type: "CAA"}]}, port, server, (_, res) => { | ||
let server; | ||
if (opts.server && net.isIP(server)) { | ||
if (opts.server) { | ||
server = opts.server; | ||
} else { | ||
const servers = require("dns").getServers(); | ||
if (servers || servers[0]) { | ||
server = servers[0]; | ||
} else { | ||
server = "8.8.8.8"; | ||
} | ||
server = (servers && servers[0]) ? servers[0] : "8.8.8.8"; | ||
} | ||
@@ -48,5 +41,7 @@ | ||
let caa; | ||
const socket = dnsSocket(); | ||
while (name && !caa) { | ||
try { | ||
caa = await resolve({name, server, port}); | ||
caa = await resolve({name, socket, server, port}); | ||
} catch (err) {} | ||
@@ -56,3 +51,5 @@ name = name.split(".").splice(1).join("."); | ||
socket.destroy(); | ||
return caa || null; | ||
}; |
{ | ||
"name": "caa", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "rfc6844-conform CAA record lookup", | ||
@@ -27,6 +27,6 @@ "author": "silverwind <me@silverwind.io>", | ||
"devDependencies": { | ||
"eslint": "^4.19.1", | ||
"eslint-config-silverwind": "^1.0.42", | ||
"updates": "^3.0.0" | ||
"eslint": "^5.2.0", | ||
"eslint-config-silverwind": "^1.0.45", | ||
"updates": "^4.1.2" | ||
} | ||
} |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
2
4105
42