From c502a1b6ab47ec3499f0ff6c6ef716275fdd0af6 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 3 Oct 2020 11:28:56 +0800 Subject: [PATCH] fix bug --- CFWorkers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CFWorkers.js b/CFWorkers.js index 8b7564d..8d3084c 100644 --- a/CFWorkers.js +++ b/CFWorkers.js @@ -76,7 +76,7 @@ async function fetchAndApply(host, request) { while (out_body.includes(replace_path)) out_body = out_body.replace(replace_path, replaced_path); } else if (contentType.includes("text/html")) { out_body = await response.text(); - while (out_body.includes(replace_path)) out_body = out_body.replace(replace_path, replaced_path); + while (replace_path!='/'&&out_body.includes(replace_path)) out_body = out_body.replace(replace_path, replaced_path); } else { out_body = await response.body; }