From db04a36752014de1fb05da3a9576b33ee8b33629 Mon Sep 17 00:00:00 2001 From: CMLiussss <24787744+cmliu@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:23:33 +0800 Subject: [PATCH] Update _worker.js --- _worker.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/_worker.js b/_worker.js index 4b2e5d6..f565369 100644 --- a/_worker.js +++ b/_worker.js @@ -1535,8 +1535,7 @@ async function getAddressescsv(tls) { // 检查CSV头部是否包含必需字段 const header = lines[0].split(','); const tlsIndex = header.indexOf('TLS'); - const speedIndex = header.length - 1; // 最后一个字段 - + const ipAddressIndex = 0;// IP地址在 CSV 头部的位置 const portIndex = 1;// 端口在 CSV 头部的位置 const dataCenterIndex = tlsIndex + 1; // 数据中心是 TLS 的后一个字段 @@ -1549,7 +1548,7 @@ async function getAddressescsv(tls) { // 从第二行开始遍历CSV行 for (let i = 1; i < lines.length; i++) { const columns = lines[i].split(','); - + const speedIndex = columns.length - 1; // 最后一个字段 // 检查TLS是否为"TRUE"且速度大于DLS if (columns[tlsIndex].toUpperCase() === tls && parseFloat(columns[speedIndex]) > DLS) { const ipAddress = columns[ipAddressIndex];