mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-12-01 08:51:41 +00:00
fix: 修复 doh
This commit is contained in:
2 files changed
+9
-5
No files matched your search
@@ -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": {
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user