feat: there does not seem to be a way to get ip otherwise
All checks were successful
ci / docker (push) Successful in 4m29s

This commit is contained in:
Tine 2024-04-22 21:05:50 +02:00
parent 9ca1f99991
commit 3718e5a47f
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw

View file

@ -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);
});