mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2026-04-02 00:03:18 +08:00
fix: 修复 Egern 和 Stash 可根据 User-Agent 自动包含官方/商店版/未续费订阅不支持的协议
This commit is contained in:
@@ -62,11 +62,26 @@ export function getPlatformFromHeaders(headers) {
|
||||
}
|
||||
export function shouldIncludeUnsupportedProxy(platform, ua) {
|
||||
try {
|
||||
const target = getPlatformFromUserAgent({
|
||||
UA: ua,
|
||||
ua: ua.toLowerCase(),
|
||||
});
|
||||
if (!['Stash', 'Egern'].includes(target)) {
|
||||
return false;
|
||||
}
|
||||
const version = coerce(ua).version;
|
||||
if (platform === 'Stash' && gte(version, '2.8.0')) {
|
||||
if (
|
||||
platform === 'Stash' &&
|
||||
target === 'Stash' &&
|
||||
gte(version, '2.8.0')
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
if (platform === 'Egern' && gte(version, '1.29.0')) {
|
||||
if (
|
||||
platform === 'Egern' &&
|
||||
target === 'Egern' &&
|
||||
gte(version, '1.29.0')
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user