mirror of
https://github.com/tiennm99/cloudflare-proxy.git
synced 2026-08-20 06:23:18 +00:00
Update worker.js
Remove origin IP from header
This commit is contained in:
@@ -36,6 +36,12 @@ async function handleRequest(request) {
|
||||
try {
|
||||
const method = request.method;
|
||||
const headers = new Headers(request.headers);
|
||||
headers.delete("Cf-Connecting-Ip");
|
||||
headers.delete("x-forwarded-for");
|
||||
headers.delete("x-real-ip");
|
||||
headers.delete("forwarded");
|
||||
headers.delete("cdn-loop");
|
||||
|
||||
const contentType = headers.get("Content-Type");
|
||||
if (contentType && contentType.startsWith("application/json") && !contentType.includes("charset")) {
|
||||
headers.set("Content-Type", "application/json; charset=UTF-8");
|
||||
|
||||
Reference in New Issue
Block a user