From 3718e5a47f25b79e4b1371913ad3b72045d27948 Mon Sep 17 00:00:00 2001 From: Tine Date: Mon, 22 Apr 2024 21:05:50 +0200 Subject: [PATCH] feat: there does not seem to be a way to get ip otherwise --- server/server.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/server.ts b/server/server.ts index 211850d..f9d13d1 100644 --- a/server/server.ts +++ b/server/server.ts @@ -83,7 +83,10 @@ app.get("/js/script.js", async (c) => { app.post("/api/event", (c) => { const request = new Request(c.req.raw); request.headers.delete("Cookie"); - request.headers.set("X-Forwarded-For", c.req.header("host") || ""); + request.headers.set( + "X-Forwarded-For", + c.req.header("X-Forwarded-For") || "unknown", + ); return fetch("https://plausible.io/api/event", request); });