Skip to content

Commit

Permalink
chore: revert axios usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tngzixiang committed May 6, 2024
1 parent c136554 commit 2e3c991
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@ export type CustomDnsResolver = (domain: string) => Promise<IDNSQueryResponse>;

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;
Expand Down

0 comments on commit 2e3c991

Please sign in to comment.