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

cf-doh

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-doh - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "cf-doh",
"version": "1.0.1",
"version": "1.0.2",
"description": "Typed Cloudflare DNS Over HTTP Resolver",

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

@@ -230,3 +230,11 @@ "use strict";

}
return [2 /*return*/, r.Answer.map(function (r) { return r.data; })];
return [2 /*return*/, r.Answer.map(function (r) {
try {
// Text records are returned wrapped in quotes, parse them to strip the quotes
return JSON.parse(r.data);
}
catch (e) {
return r.data;
}
})];
}

@@ -233,0 +241,0 @@ });

@@ -66,7 +66,11 @@ # cf-doh

const response = await queryDNS("_verification.jesseditson.com", "TXT");
const response = await queryDNSRecords("_verification.jesseditson.com", "TXT");
if (response.status === DOHStatus.NoError) {
const records = r.Answer.map((r) => r.data);
const records = r.Answer.map((r) => JSON.parse(r.data));
}
```
## Caveats and Notes
Cloudflare returns quoted strings for standardized record types, and hex values for unknown record types. This means that for most records, the string you get back will include double quotes. `queryDNS` uses `JSON.parse()` to strip these quotes before returning them, so if you're using `queryDNSRecords` directly, you'll need to process these values to use them as strings.

Sorry, the diff of this file is not supported yet

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