Compare commits

...

1 Commits

Author SHA1 Message Date
xream
fcc9d047ae fix: 修复 edns sourcePrefixLength 2024-12-21 21:13:09 +08:00
2 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.444",
"version": "2.14.445",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

View File

@@ -1,6 +1,7 @@
import $ from '@/core/app';
import dnsPacket from 'dns-packet';
import { Buffer } from 'buffer';
import { isIPv4 } from '@/utils';
export async function doh({ url, domain, type = 'A', timeout, edns }) {
const buf = dnsPacket.encode({
@@ -23,7 +24,7 @@ export async function doh({ url, domain, type = 'A', timeout, edns }) {
{
code: 'CLIENT_SUBNET',
ip: edns,
sourcePrefixLength: 24,
sourcePrefixLength: isIPv4(edns) ? 24 : 56,
scopePrefixLength: 0,
},
],