From 08f73f61dda4b33f30e326580cbc28784f13b9bc Mon Sep 17 00:00:00 2001 From: LittleChest Date: Tue, 22 Jul 2025 17:27:42 +0800 Subject: [PATCH] common: Update request headers * Clean up JSON API headers * Add IP to DNS query headers * Add User Agent headers --- common.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common.js b/common.js index b0609a6..469e18f 100644 --- a/common.js +++ b/common.js @@ -31,7 +31,7 @@ export default async function handler( res = fetch(api + search, { method: "GET", headers: { - Accept: "application/dns-json", + "User-Agent": "Dohna-NS (https://github.com/LittleChest/Dohna-NS)", }, }); } @@ -88,6 +88,9 @@ async function queryDns(queryData, ip, dns) { method: "POST", headers: { "Content-Type": "application/dns-message", + Accept: "application/dns-message", + "User-Agent": "Dohna-NS (https://github.com/LittleChest/Dohna-NS)", + "X-Forwarded-For": ip, }, body: newQueryData, });