feat: 处理 reality-opts 为 {} 的情况

This commit is contained in:
xream 2024-07-02 20:39:04 +08:00
parent f524920c13
commit 9d29fc8a09
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.14.345", "version": "2.14.346",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -408,6 +408,13 @@ function lastParse(proxy) {
delete proxy.ports; delete proxy.ports;
} }
if (['vless'].includes(proxy.type)) { if (['vless'].includes(proxy.type)) {
// 删除 reality-opts: {}
if (
proxy['reality-opts'] &&
Object.keys(proxy['reality-opts']).length === 0
) {
delete proxy['reality-opts'];
}
// 非 reality, 空 flow 没有意义 // 非 reality, 空 flow 没有意义
if (!proxy['reality-opts'] && !proxy.flow) { if (!proxy['reality-opts'] && !proxy.flow) {
delete proxy.flow; delete proxy.flow;