From bee1d62a1a2e7ef67294e44c865e59bf3df48899 Mon Sep 17 00:00:00 2001 From: xream Date: Thu, 5 Sep 2024 17:15:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=A0=E8=BE=93=E5=B1=82=20path=20?= =?UTF-8?q?=E5=BA=94=E4=BB=A5=20/=20=E5=BC=80=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/index.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 6ff2c1b5f..224ae7026 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.378", + "version": "2.14.379", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index ddf0d06e9..4f2a4f0cb 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -501,6 +501,18 @@ function lastParse(proxy) { proxy[`${proxy.network}-opts`].path = ['/']; } } + const transportPath = proxy[`${proxy.network}-opts`]?.path; + if (Array.isArray(transportPath)) { + transportPath.forEach((path, index) => { + if (!path.startsWith('/')) { + proxy[`${proxy.network}-opts`].path[index] = `/${path}`; + } + }); + } else if (transportPath) { + if (!transportPath.startsWith('/')) { + proxy[`${proxy.network}-opts`].path = `/${transportPath}`; + } + } if (['', 'off'].includes(proxy.sni)) { proxy['disable-sni'] = true; }