Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

fix: stabilize rate limiter key (#6020)

authored by yoginth.com and committed by

GitHub 77cdbe4a 4df98510

+2 -2
+2 -2
apps/api/src/middlewares/rateLimiter.ts
··· 21 21 const rateLimiter = ({ requests }: RateLimiterOptions) => { 22 22 return rateLimit({ 23 23 keyGenerator: (c) => { 24 - const urlHash = sha256(c.req.url).slice(0, 25); 25 - const key = `rate-limit:${urlHash}:${hashedIp(c.req.raw)}`; 24 + const pathHash = sha256(c.req.path).slice(0, 25); 25 + const key = `rate-limit:${pathHash}:${hashedIp(c.req.raw)}`; 26 26 return key; 27 27 }, // 1 minute 28 28 limit: requests,