Skip to content

Commit

Permalink
fix: proxy duplicate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Peng-YM committed Aug 4, 2022
1 parent f64e8ec commit 26820ea
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
6 changes: 3 additions & 3 deletions backend/dist/cron-sync-artifacts.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions backend/dist/sub-store-parser.loon.min.js

Large diffs are not rendered by default.

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.12.1",
"version": "2.12.2",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions backend/src/core/proxy-utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function parse(raw) {
lastParser = parser;
success = true;
$.info(`${parser.name} is activated`);
break;
}
}
}
Expand Down
22 changes: 14 additions & 8 deletions backend/src/core/proxy-utils/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ function URI_SSR() {
line = line.split('/?')[1].split('&');
if (line.length > 1) {
for (const item of line) {
const [key, val] = item.split('=');
other_params[key] = val.trim();
let [key, val] = item.split('=');
val = val.trim();
if (val.length > 0) {
other_params[key] = val;
}
}
}
proxy = {
Expand Down Expand Up @@ -242,14 +245,17 @@ function URI_Trojan() {
const name = decodeURIComponent(line.split('#')[1].trim());
let paramArr = line.split('?');
let scert = null;
let params;
const params = new Map();
if (paramArr.length > 1) {
paramArr = paramArr[1].split('#')[0].split('&');
params = new Map(
paramArr.map((item) => {
return item.split('=');
}),
);
for (const pair of paramArr) {
let [key, val] = pair.split('=');
// skip empty values
val = val.trim();
if (val.length > 0) {
params.set(key, val);
}
}
if (
params.get('allowInsecure') === '1' ||
params.get('allowInsecure') === 'true'
Expand Down
6 changes: 3 additions & 3 deletions backend/sub-store.min.js

Large diffs are not rendered by default.

0 comments on commit 26820ea

Please sign in to comment.