From c3847f6ca3ebaff26b8b217301edf4fb2abba05b Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Fri, 2 May 2025 12:25:42 +0800 Subject: [PATCH] update 2025-05-02 12:25:42 --- .../root/usr/share/passwall/subscribe.lua | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index b257ca816..3d87fc54c 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -549,8 +549,8 @@ local function processData(szType, content, add_mode, add_from) info.type = "none" end result.tcp_guise = info.type - result.tcp_guise_http_host = info.host - result.tcp_guise_http_path = info.path + result.tcp_guise_http_host = (info.host and info.host ~= "") and { info.host } or nil + result.tcp_guise_http_path = (info.path and info.path ~= "") and { info.path } or nil end if info.net == 'kcp' or info.net == 'mkcp' then info.net = "mkcp" @@ -707,7 +707,7 @@ local function processData(szType, content, add_mode, add_from) if obfs == "http" then result.transport = "raw" result.tcp_guise = "http" - result.tcp_guise_http_host = obfs_host + result.tcp_guise_http_host = (obfs_host and obfs_host ~= "") and { obfs_host } or nil elseif obfs == "tls" then result.tls = "1" result.tls_serverName = obfs_host @@ -783,8 +783,8 @@ local function processData(szType, content, add_mode, add_from) end if params.type == 'raw' or params.type == 'tcp' then result.tcp_guise = params.headerType or "none" - result.tcp_guise_http_host = params.host - result.tcp_guise_http_path = params.path + result.tcp_guise_http_host = (params.host and params.host ~= "") and { params.host } or nil + result.tcp_guise_http_path = (params.path and params.path ~= "") and { params.path } or nil end if params.type == 'kcp' or params.type == 'mkcp' then result.transport = "mkcp" @@ -944,8 +944,8 @@ local function processData(szType, content, add_mode, add_from) end if params.type == 'raw' or params.type == 'tcp' then result.tcp_guise = params.headerType or "none" - result.tcp_guise_http_host = params.host - result.tcp_guise_http_path = params.path + result.tcp_guise_http_host = (params.host and params.host ~= "") and { params.host } or nil + result.tcp_guise_http_path = (params.path and params.path ~= "") and { params.path } or nil end if params.type == 'kcp' or params.type == 'mkcp' then result.transport = "mkcp" @@ -1091,8 +1091,8 @@ local function processData(szType, content, add_mode, add_from) end if params.type == 'raw' or params.type == 'tcp' then result.tcp_guise = params.headerType or "none" - result.tcp_guise_http_host = params.host - result.tcp_guise_http_path = params.path + result.tcp_guise_http_host = (params.host and params.host ~= "") and { params.host } or nil + result.tcp_guise_http_path = (params.path and params.path ~= "") and { params.path } or nil end if params.type == 'kcp' or params.type == 'mkcp' then result.transport = "mkcp" @@ -1621,10 +1621,14 @@ local function update_node(manual) for _, vv in ipairs(list) do local cfgid = uci:section(appname, "nodes", api.gen_short_uuid()) for kkk, vvv in pairs(vv) do - uci:set(appname, cfgid, kkk, vvv) - -- sing-box 域名解析策略 - if kkk == "type" and vvv == "sing-box" then - uci:set(appname, cfgid, "domain_strategy", domain_strategy_node) + if type(vvv) == "table" and next(vvv) ~= nil then + uci:set_list(appname, cfgid, kkk, vvv) + else + uci:set(appname, cfgid, kkk, vvv) + -- sing-box 域名解析策略 + if kkk == "type" and vvv == "sing-box" then + uci:set(appname, cfgid, "domain_strategy", domain_strategy_node) + end end end end