From 721242596167f5462d366c5637e716e4419e3970 Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Mon, 8 Dec 2025 01:36:41 +0100 Subject: [PATCH] fix: use forEach instead of for-of to iterate Map entries --- app/lib/uploadRateLimiter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/uploadRateLimiter.ts b/app/lib/uploadRateLimiter.ts index 62b2ba1..ee17e55 100644 --- a/app/lib/uploadRateLimiter.ts +++ b/app/lib/uploadRateLimiter.ts @@ -60,11 +60,11 @@ export function checkUploadRateLimit(ipAddress: string): { allowed: boolean; rem */ export function cleanupRateLimitStore() { const now = Date.now(); - for (const [key, entry] of rateLimitStore.entries()) { + rateLimitStore.forEach((entry, key) => { if (now > entry.resetAt) { rateLimitStore.delete(key); } - } + }); } // Auto-cleanup every 10 minutes