mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-14 12:25:57 +08:00
fix: 修复 edns sourcePrefixLength
This commit is contained in:
parent
382d22e622
commit
fcc9d047ae
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.444",
|
"version": "2.14.445",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import $ from '@/core/app';
|
import $ from '@/core/app';
|
||||||
import dnsPacket from 'dns-packet';
|
import dnsPacket from 'dns-packet';
|
||||||
import { Buffer } from 'buffer';
|
import { Buffer } from 'buffer';
|
||||||
|
import { isIPv4 } from '@/utils';
|
||||||
|
|
||||||
export async function doh({ url, domain, type = 'A', timeout, edns }) {
|
export async function doh({ url, domain, type = 'A', timeout, edns }) {
|
||||||
const buf = dnsPacket.encode({
|
const buf = dnsPacket.encode({
|
||||||
@ -23,7 +24,7 @@ export async function doh({ url, domain, type = 'A', timeout, edns }) {
|
|||||||
{
|
{
|
||||||
code: 'CLIENT_SUBNET',
|
code: 'CLIENT_SUBNET',
|
||||||
ip: edns,
|
ip: edns,
|
||||||
sourcePrefixLength: 24,
|
sourcePrefixLength: isIPv4(edns) ? 24 : 56,
|
||||||
scopePrefixLength: 0,
|
scopePrefixLength: 0,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user