From 32479a9dcf9c7d0968b84328f797f4bdfd0ba198 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 3 Oct 2020 09:47:18 +0800 Subject: [PATCH] fix bug --- CFWorkers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CFWorkers.js b/CFWorkers.js index 55f57dd..8b7564d 100644 --- a/CFWorkers.js +++ b/CFWorkers.js @@ -51,7 +51,7 @@ async function fetchAndApply(host, request) { let response = null; if (!CFproxy) { - response = await fetch(request); + response = await fetch(f_url, request); } else { let method = request.method; let body = request.body; @@ -70,7 +70,7 @@ async function fetchAndApply(host, request) { let out_headers = new Headers(response.headers); if (out_headers.get('Content-Disposition')=='attachment') out_headers.delete('Content-Disposition'); let out_body = null; - let contentType = out_headers.get('content-type'); + let contentType = out_headers.get('Content-Type'); if (contentType.includes("application/text")) { out_body = await response.text(); while (out_body.includes(replace_path)) out_body = out_body.replace(replace_path, replaced_path);