From 67ffca05bbb0162369a14dfdae138dee6e6ecdff Mon Sep 17 00:00:00 2001 From: cmliu Date: Fri, 7 Nov 2025 19:53:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96IP=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E4=B8=8D=E8=A7=84=E8=8C=83=E6=A0=BC=E5=BC=8F=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AD=A6=E5=91=8A=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_worker.js b/_worker.js index 1c249fc..c17c0bc 100644 --- a/_worker.js +++ b/_worker.js @@ -244,13 +244,13 @@ export default { 节点端口 = match[2] || "443"; // 端口,默认443 节点备注 = match[3] || 节点地址; // 备注,默认为地址本身 } else { - // 兜底处理:无法匹配时使用原始地址 - 节点地址 = 原始地址; - 节点备注 = 原始地址; + // 不规范的格式,跳过处理返回null + console.warn(`[订阅内容] 不规范的IP格式已忽略: ${原始地址}`); + return null; } return `${协议类型}://${config_JSON.UUID}@${节点地址}:${节点端口}?security=tls&type=${config_JSON.传输协议}&host=${config_JSON.HOST}&sni=${config_JSON.HOST}&path=${encodeURIComponent(config_JSON.PATH)}&fragment=${encodeURIComponent('1,40-60,30-50,tlshello')}&encryption=none${config_JSON.跳过证书验证 ? '&allowInsecure=1' : ''}#${encodeURIComponent(节点备注)}`; - }).join('\n'); + }).filter(item => item !== null).join('\n'); 订阅内容 = btoa(订阅内容); } else { // 优选订阅生成器 let 优选订阅生成器HOST = url.searchParams.get('sub') || config_JSON.优选订阅生成.SUB;