From 2e3c991a2bf6e780967cea05ce3d25dbc1e4debc Mon Sep 17 00:00:00 2001 From: tngzixiang Date: Mon, 6 May 2024 16:04:17 +0800 Subject: [PATCH] chore: revert axios usage --- src/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 28042d1..6d279e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -26,12 +26,17 @@ export type CustomDnsResolver = (domain: string) => Promise; export const defaultDnsResolvers: CustomDnsResolver[] = [ async (domain) => { - const { data } = await axios.get(`https://dns.google/resolve?name=${domain}&type=TXT`); + const { data } = await axios({ + method: "GET", + url: `https://dns.google/resolve?name=${domain}&type=TXT`, + }); return data; }, async (domain) => { - const { data } = await axios.get(`https://cloudflare-dns.com/dns-query?name=${domain}&type=TXT`, { + const { data } = await axios({ + method: "GET", + url: `https://cloudflare-dns.com/dns-query?name=${domain}&type=TXT`, headers: { accept: "application/dns-json", contentType: "application/json", connection: "keep-alive" }, }); return data;