From 4a8d90e8368350cbdebace0b8aca82d1bdf7e9f7 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Mon, 20 Oct 2025 22:05:17 +0000 Subject: [PATCH] fix(pockethost): correct IP variable usage in rate limiter middleware --- .../FirewallCommand/ServeCommand/firewall/rate-limiter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/rate-limiter.ts b/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/rate-limiter.ts index a2670934..8318ad35 100644 --- a/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/rate-limiter.ts +++ b/packages/pockethost/src/cli/commands/FirewallCommand/ServeCommand/firewall/rate-limiter.ts @@ -84,11 +84,11 @@ export const createRateLimiterMiddleware = ( return next() } - const ip = getClientIp(req) - if (isUserProxy(ip)) { - dbg(`User Proxy IP detected: ${ip}`, req.headers) + if (isUserProxy(connectingIp)) { + dbg(`User Proxy IP detected: ${connectingIp}`, req.headers) } + const ip = getClientIp(req) if (!ip) { warn(`Could not determine IP address`) res.status(429).send(`IP address not found`)