fix: 修复 doh

This commit is contained in:
xream committed 2025-08-16 11:38:13 +08:00
1 parent 039bf8843c
commit 94c820e4ad
2 files changed
+9 -5

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.20.5",
"version": "2.20.6",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {
+8 -4
View File
@@ -31,11 +31,15 @@ export async function doh({ url, domain, type = 'A', timeout, edns }) {
},
],
});
const b64 = Buffer.from(buf).toString('base64');
const b64url = b64
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=+$/, '');
const res = await $.http.get({
url: `${url}?dns=${buf
.toString('base64')
.toString('utf-8')
.replace(/=/g, '')}`,
url: `${url}?dns=${encodeURIComponent(b64url)}`,
headers: {
Accept: 'application/dns-message',
// 'Content-Type': 'application/dns-message',