From c1365549dd257f072e5c35698015c2c3c5e0c493 Mon Sep 17 00:00:00 2001 From: tngzixiang Date: Mon, 6 May 2024 15:34:30 +0800 Subject: [PATCH] fix: use node module axios --- src/index.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7f13aaa..28042d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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"; @@ -26,17 +26,12 @@ export type CustomDnsResolver = (domain: string) => Promise; 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;