This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
async fetch(request) { | |
// Clone the incoming request headers to make them mutable. | |
const newRequestHeaders = new Headers(request.headers); | |
// Get the actual client IP from Cloudflare metadata | |
// (cf-connecting-ip is automatically provided by Cloudflare) | |
const clientIp = request.headers.get("cf-connecting-ip") || ""; | |
// Define your trusted Cloudflare markers |