Aktueller Stand
This commit is contained in:
5
lib/request.ts
Normal file
5
lib/request.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const getClientIp = (req: Request) => {
|
||||
const forwarded = req.headers.get("x-forwarded-for") || req.headers.get("x-real-ip");
|
||||
if (!forwarded) return "unknown";
|
||||
return forwarded.split(",")[0].trim() || "unknown";
|
||||
};
|
||||
Reference in New Issue
Block a user