From ee2fcc7ee3a809ddb8115f302729d97d120b0cc0 Mon Sep 17 00:00:00 2001 From: xream Date: Mon, 8 Jan 2024 09:28:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=B8=8D=E5=B8=A6=E5=8F=82=E6=95=B0=E7=9A=84=20URI=20=E8=BE=93?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/parsers/index.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/package.json b/backend/package.json index e981877..ae3382f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.141", + "version": "2.14.142", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index e08e6d4..02f88dc 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -332,8 +332,8 @@ function URI_VLESS() { const parse = (line) => { line = line.split('vless://')[1]; // eslint-disable-next-line no-unused-vars - let [__, uuid, server, port, addons, name] = - /^(.*?)@(.*?):(\d+)\/?\?(.*?)(?:#(.*?))$/.exec(line); + let [__, uuid, server, port, ___, addons = '', name] = + /^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))$/.exec(line); port = parseInt(`${port}`, 10); uuid = decodeURIComponent(uuid); name = decodeURIComponent(name) ?? `VLESS ${server}:${port}`; @@ -414,8 +414,8 @@ function URI_Hysteria2() { const parse = (line) => { line = line.split(/(hysteria2|hy2):\/\//)[2]; // eslint-disable-next-line no-unused-vars - let [__, password, server, ___, port, addons, name] = - /^(.*?)@(.*?)(:(\d+))?\/?\?(.*?)(?:#(.*?))$/.exec(line); + let [__, password, server, ___, port, ____, addons = '', name] = + /^(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))$/.exec(line); port = parseInt(`${port}`, 10); if (isNaN(port)) { port = 443;