mirror of
https://github.com/LittleChest/Dohna-NS.git
synced 2026-05-06 22:44:50 +08:00
common: Update request headers
* Clean up JSON API headers * Add IP to DNS query headers * Add User Agent headers
This commit is contained in:
parent
05a6acb27a
commit
08f73f61dd
@ -31,7 +31,7 @@ export default async function handler(
|
|||||||
res = fetch(api + search, {
|
res = fetch(api + search, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
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",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/dns-message",
|
"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,
|
body: newQueryData,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user