From 455e87c168c2300804109f13f83b8f2cdd058bdd Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 12 Sep 2022 14:29:34 -0400 Subject: [PATCH] Pass ##EXTERNAL_IP## to the client to replace --- src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e669c7d..900cc39 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,13 +65,13 @@ pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result { let mut conf = base + ""; - let remote_ip = - match _req.headers().get("CF-Connecting-IP").unwrap_or_default() { - Some(ip) => ip, - None => return Response::error("Could not find remote IP", 500), - }; + // let remote_ip = + // match _req.headers().get("CF-Connecting-IP").unwrap_or_default() { + // Some(ip) => ip, + // None => return Response::error("Could not find remote IP", 500), + // }; - conf = conf.replace("##EXTERNAL_IP##", &remote_ip) + "\n"; + // conf = conf.replace("##EXTERNAL_IP##", &remote_ip) + "\n"; match kv.get("users").cache_ttl(300).text().await? { Some(users) => {