Skip to content

Commit

Permalink
fix: 默认 User-Agent 改为 clash.meta 后, 调整订阅预处理器的逻辑, 减少 Base64 误判
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Dec 5, 2023
1 parent 000e90d commit 75f802f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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.110",
"version": "2.14.111",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions backend/src/core/proxy-utils/preprocessors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ function Base64Encoded() {
function Clash() {
const name = 'Clash Pre-processor';
const test = function (raw) {
return /proxies/.test(raw);
if (!/proxies/.test(raw)) return false;
const content = safeLoad(raw);
return content.proxies && Array.isArray(content.proxies);
};
const parse = function (raw) {
// Clash YAML format
Expand Down Expand Up @@ -108,4 +110,4 @@ function FullConfig() {
return { name, test, parse };
}

export default [HTML(), Base64Encoded(), Clash(), SSD(), FullConfig()];
export default [HTML(), Clash(), Base64Encoded(), SSD(), FullConfig()];

0 comments on commit 75f802f

Please sign in to comment.