Skip to content

Commit

Permalink
fix: use node module axios
Browse files Browse the repository at this point in the history
  • Loading branch information
tngzixiang committed May 6, 2024
1 parent 68ba1c7 commit c136554
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios from "axios";
import axios from "../node_modules/axios";
import { OpenAttestationDNSTextRecord, OpenAttestationDNSTextRecordT } from "./records/dnsTxt";
import { OpenAttestationDnsDidRecord, OpenAttestationDnsDidRecordT } from "./records/dnsDid";
import { getLogger } from "./util/logger";
Expand Down Expand Up @@ -26,17 +26,12 @@ export type CustomDnsResolver = (domain: string) => Promise<IDNSQueryResponse>;

export const defaultDnsResolvers: CustomDnsResolver[] = [
async (domain) => {
const { data } = await axios({
method: "GET",
url: `https://dns.google/resolve?name=${domain}&type=TXT`,
});
const { data } = await axios.get(`https://dns.google/resolve?name=${domain}&type=TXT`);

return data;
},
async (domain) => {
const { data } = await axios({
method: "GET",
url: `https://cloudflare-dns.com/dns-query?name=${domain}&type=TXT`,
const { data } = await axios.get(`https://cloudflare-dns.com/dns-query?name=${domain}&type=TXT`, {
headers: { accept: "application/dns-json", contentType: "application/json", connection: "keep-alive" },
});
return data;
Expand Down

0 comments on commit c136554

Please sign in to comment.