Skip to content

Commit 14a3488

Browse files
committed
fix: 修复 Egern 和 Stash 可根据 User-Agent 自动包含官方/商店版/未续费订阅不支持的协议
1 parent 6afec4f commit 14a3488

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.16.20",
3+
"version": "2.16.21",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/utils/user-agent.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,26 @@ export function getPlatformFromHeaders(headers) {
6262
}
6363
export function shouldIncludeUnsupportedProxy(platform, ua) {
6464
try {
65+
const target = getPlatformFromUserAgent({
66+
UA: ua,
67+
ua: ua.toLowerCase(),
68+
});
69+
if (!['Stash', 'Egern'].includes(target)) {
70+
return false;
71+
}
6572
const version = coerce(ua).version;
66-
if (platform === 'Stash' && gte(version, '2.8.0')) {
73+
if (
74+
platform === 'Stash' &&
75+
target === 'Stash' &&
76+
gte(version, '2.8.0')
77+
) {
6778
return true;
6879
}
69-
if (platform === 'Egern' && gte(version, '1.29.0')) {
80+
if (
81+
platform === 'Egern' &&
82+
target === 'Egern' &&
83+
gte(version, '1.29.0')
84+
) {
7085
return true;
7186
}
7287
} catch (e) {

0 commit comments

Comments
 (0)