From a6dc025bc4c975f42617028db1b77013e4f80928 Mon Sep 17 00:00:00 2001 From: cmliu Date: Wed, 28 Jan 2026 17:14:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E8=AF=BB=E5=8F=96conf?= =?UTF-8?q?ig=5FJSON=E5=87=BD=E6=95=B0=EF=BC=8C=E4=BF=AE=E5=A4=8DPATH?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E4=BB=A5?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _worker.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/_worker.js b/_worker.js index 7b1824c..12ccbed 100644 --- a/_worker.js +++ b/_worker.js @@ -1448,6 +1448,7 @@ async function 读取config_JSON(env, hostname, userID, 重置配置 = false) { const { SOCKS5, PROXYIP } = config_JSON.反代; const PATH反代参数 = SOCKS5.启用 ? `${SOCKS5.启用}${SOCKS5.全局 ? '://' : '='}${SOCKS5.账号}` : (PROXYIP === 'auto' ? '' : `proxyip=${PROXYIP}`); + config_JSON.PATH = config_JSON.PATH.replace(PATH反代参数, '').replace('//', '/'); const normalizedPath = config_JSON.PATH === '/' ? '' : config_JSON.PATH.replace(/\/+(?=\?|$)/, '').replace(/\/+$/, ''); const [路径部分, ...查询数组] = normalizedPath.split('?'); const 查询部分 = 查询数组.length ? '?' + 查询数组.join('?') : ''; @@ -1513,11 +1514,11 @@ async function 读取config_JSON(env, hostname, userID, 重置配置 = false) { async function 生成随机IP(request, count = 16, 指定端口 = -1) { const ISP配置 = { - '9808': { file: 'cmcc', name: 'CF移动优选' }, - '4837': { file: 'cu', name: 'CF联通优选' }, - '17623': { file: 'cu', name: 'CF联通优选' }, - '17816': { file: 'cu', name: 'CF联通优选' }, - '4134': { file: 'ct', name: 'CF电信优选' }, + '9808': { file: 'cmcc', name: 'CF移动优选' }, + '4837': { file: 'cu', name: 'CF联通优选' }, + '17623': { file: 'cu', name: 'CF联通优选' }, + '17816': { file: 'cu', name: 'CF联通优选' }, + '4134': { file: 'ct', name: 'CF电信优选' }, }; const asn = request.cf.asn, isp = ISP配置[asn]; const cidr_url = isp ? `https://raw.githubusercontent.com/cmliu/cmliu/main/CF-CIDR/${isp.file}.txt` : 'https://raw.githubusercontent.com/cmliu/cmliu/main/CF-CIDR.txt';