Skip to content

Commit

Permalink
chore: bump release version
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Oct 11, 2024
2 parents ef85b6d + 97bec91 commit 71d9adb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 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.391",
"version": "2.14.392",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
24 changes: 23 additions & 1 deletion backend/src/core/proxy-utils/preprocessors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,32 @@ function Clash() {
};
const parse = function (raw) {
// Clash YAML format

// 防止 VLESS节点 reality-opts 选项中的 short-id 被解析成 Infinity
// 匹配 short-id 冒号后面的值(包含空格和引号)
const afterReplace = raw.replace(
/short-id:([ ]*[^,\n}]*)/g,
(matched, value) => {
const afterTrim = value.trim();

// 为空
if (!afterTrim || afterTrim === '') {
return 'short-id: ""'
}

// 是否被引号包裹
if (/^(['"]).*\1$/.test(afterTrim)) {
return `short-id: ${afterTrim}`;
} else {
return `short-id: "${afterTrim}"`
}
}
);

const {
proxies,
'global-client-fingerprint': globalClientFingerprint,
} = safeLoad(raw);
} = safeLoad(afterReplace);
return proxies
.map((p) => {
// https://github.com/MetaCubeX/mihomo/blob/Alpha/docs/config.yaml#L73C1-L73C26
Expand Down

0 comments on commit 71d9adb

Please sign in to comment.