mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 01:18:59 +08:00
fix: 被识别为 IP4P 的域名解析结果均增加 _IP4P 字段; 修复报错
This commit is contained in:
parent
a0c1bbbf70
commit
aa0943a909
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.350",
|
"version": "2.14.351",
|
||||||
"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": {
|
||||||
|
@ -627,8 +627,15 @@ function ResolveDomainOperator({
|
|||||||
]
|
]
|
||||||
: results[p.server];
|
: results[p.server];
|
||||||
if (type === 'IPv6' && isIPv6(ip)) {
|
if (type === 'IPv6' && isIPv6(ip)) {
|
||||||
ip = new ipAddress.Address6(ip).correctForm();
|
try {
|
||||||
|
ip = new ipAddress.Address6(ip).correctForm();
|
||||||
|
} catch (e) {
|
||||||
|
$.error(
|
||||||
|
`Failed to parse IPv6 address: ${ip}: ${e}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
if (/^2001::[^:]+:[^:]+:[^:]+$/.test(ip)) {
|
if (/^2001::[^:]+:[^:]+:[^:]+$/.test(ip)) {
|
||||||
|
p._IP4P = ip;
|
||||||
const { server, port } = parseIP4P(ip);
|
const { server, port } = parseIP4P(ip);
|
||||||
if (server && port) {
|
if (server && port) {
|
||||||
p._domain = p.server;
|
p._domain = p.server;
|
||||||
@ -636,7 +643,6 @@ function ResolveDomainOperator({
|
|||||||
p.port = port;
|
p.port = port;
|
||||||
p.resolved = true;
|
p.resolved = true;
|
||||||
p._IPv4 = p.server;
|
p._IPv4 = p.server;
|
||||||
p._IP4P = ip;
|
|
||||||
if (!isIP(p._IP)) {
|
if (!isIP(p._IP)) {
|
||||||
p._IP = p.server;
|
p._IP = p.server;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user