fix: 修复对不规范的节点名称的处理

This commit is contained in:
xream 2024-04-22 02:51:44 +08:00
parent 0b5761e5fc
commit 2301ccbfb5
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 13 additions and 9 deletions

View File

@ -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": {

View File

@ -404,6 +404,9 @@ function lastParse(proxy) {
} }
} }
if (typeof proxy.name !== 'string') { if (typeof proxy.name !== 'string') {
if (/^\d+$/.test(proxy.name)) {
proxy.name = `${proxy.name}`;
} else {
try { try {
if (proxy.name?.data) { if (proxy.name?.data) {
proxy.name = Buffer.from(proxy.name.data).toString('utf8'); proxy.name = Buffer.from(proxy.name.data).toString('utf8');
@ -415,6 +418,7 @@ function lastParse(proxy) {
proxy.name = `${proxy.type} ${proxy.server}:${proxy.port}`; proxy.name = `${proxy.type} ${proxy.server}:${proxy.port}`;
} }
} }
}
if (['', 'off'].includes(proxy.sni)) { if (['', 'off'].includes(proxy.sni)) {
proxy['disable-sni'] = true; proxy['disable-sni'] = true;
} }