mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 14:39:03 +08:00
fix: 修复对不规范的节点名称的处理
This commit is contained in:
parent
0b5761e5fc
commit
2301ccbfb5
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.294",
|
"version": "2.14.295",
|
||||||
"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": {
|
||||||
|
@ -404,15 +404,19 @@ function lastParse(proxy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeof proxy.name !== 'string') {
|
if (typeof proxy.name !== 'string') {
|
||||||
try {
|
if (/^\d+$/.test(proxy.name)) {
|
||||||
if (proxy.name?.data) {
|
proxy.name = `${proxy.name}`;
|
||||||
proxy.name = Buffer.from(proxy.name.data).toString('utf8');
|
} else {
|
||||||
} else {
|
try {
|
||||||
proxy.name = utf8ArrayToStr(proxy.name);
|
if (proxy.name?.data) {
|
||||||
|
proxy.name = Buffer.from(proxy.name.data).toString('utf8');
|
||||||
|
} else {
|
||||||
|
proxy.name = utf8ArrayToStr(proxy.name);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.error(`proxy.name decode failed\nReason: ${e}`);
|
||||||
|
proxy.name = `${proxy.type} ${proxy.server}:${proxy.port}`;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
$.error(`proxy.name decode failed\nReason: ${e}`);
|
|
||||||
proxy.name = `${proxy.type} ${proxy.server}:${proxy.port}`;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (['', 'off'].includes(proxy.sni)) {
|
if (['', 'off'].includes(proxy.sni)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user