Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dat-dns

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dat-dns - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1

6

index.js

@@ -165,3 +165,3 @@ const debug = require('debug')('dat')

// ensure the name is a FQDN
if (!name.contains('.')) {
if (!name.includes('.')) {
debug('dns-over-https failed', name, 'Not an a FQDN')

@@ -186,2 +186,6 @@ datDns.emit('failed', {

path: `${path}?${stringify(query)}`,
// Cloudflare requires this exact header; luckily everyone else ignores it
headers: {
'Accept': 'application/dns-json'
},
timeout: 2000

@@ -188,0 +192,0 @@ }, function (res) {

2

package.json
{
"name": "dat-dns",
"version": "3.2.0",
"version": "3.2.1",
"description": "Issue DNS lookups for Dat archives using HTTPS requests to the target host.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -66,3 +66,3 @@ var tape = require('tape')

tape('A bad hostname fails gracefully', function (t) {
datDns.resolveName('example.com', function (err, name) {
datDns.resolveName('example.com', {ignoreCache: true}, function (err, name) {
t.ok(err)

@@ -75,3 +75,3 @@ t.notOk(name)

datDns.resolveName('foo bar', function (err, name) {
datDns.resolveName('foo bar', {ignoreCache: true}, function (err, name) {
t.ok(err)

@@ -87,3 +87,3 @@ t.notOk(name)

tape('A bad DNS record fails gracefully', function (t) {
datDns.resolveName('bad-dat-record1.beakerbrowser.com', function (err, name) {
datDns.resolveName('bad-dat-record1.beakerbrowser.com', {ignoreCache: true}, function (err, name) {
t.ok(err)

@@ -96,3 +96,3 @@ t.notOk(name)

tape('Unqualified domain fails gracefully', function (t) {
datDns.resolveName('bad-dat-domain-name', function (err, name) {
datDns.resolveName('bad-dat-domain-name', {ignoreCache: true}, function (err, name) {
t.ok(err)

@@ -105,3 +105,3 @@ t.notOk(name)

tape('Successful test against beakerbrowser.com', function (t) {
datDns.resolveName('beakerbrowser.com', function (err, name) {
datDns.resolveName('beakerbrowser.com', {ignoreCache: true}, function (err, name) {
t.error(err)

@@ -121,3 +121,3 @@ t.ok(/[0-9a-f]{64}/.test(name))

tape('Successful test against beakerbrowser.com (no dns-over-https)', function (t) {
datDns.resolveName('beakerbrowser.com', {noDnsOverHttps: true}, function (err, name) {
datDns.resolveName('beakerbrowser.com', {noDnsOverHttps: true, ignoreCache: true}, function (err, name) {
t.error(err)

@@ -137,3 +137,5 @@ t.ok(/[0-9a-f]{64}/.test(name))

tape('Successful test against beakerbrowser.com (no well-known/dat)', function (t) {
datDns.resolveName('beakerbrowser.com', {noWellknownDat: true}, function (err, name) {
console.log('running...')
datDns.resolveName('beakerbrowser.com', {noWellknownDat: true, ignoreCache: true}, function (err, name) {
console.log('res', err, name)
t.error(err)

@@ -140,0 +142,0 @@ t.ok(/[0-9a-f]{64}/.test(name))

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc