fix: 传输层 path 应以 / 开头

This commit is contained in:
xream 2024-09-05 17:15:30 +08:00
parent 72bc9b9456
commit bee1d62a1a
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 13 additions and 1 deletions

View File

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

View File

@ -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;
}