Skip to content

Commit

Permalink
fix: 传输层 path 应以 / 开头
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Sep 5, 2024
1 parent 72bc9b9 commit bee1d62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
12 changes: 12 additions & 0 deletions backend/src/core/proxy-utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bee1d62

Please sign in to comment.