From c2f3f89bc91c126442c02606f12324417fb0dd3e Mon Sep 17 00:00:00 2001 From: Sefinek Date: Tue, 10 Sep 2024 17:28:30 +0200 Subject: [PATCH] Fix entry.action === 'TOO_MANY_REQUESTS' --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index fefcf90..23eaed3 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,7 @@ const fetchBlockedIPs = async () => { }; const isIPReportedRecently = (ip, reportedIPs) => { - const lastReport = reportedIPs.find(entry => entry.ip === ip && (entry.action === 'REPORTED' || entry.action.startsWith('TOO_MANY_REQUESTS'))); + const lastReport = reportedIPs.find(entry => entry.ip === ip && (entry.action === 'REPORTED' || entry.action === 'TOO_MANY_REQUESTS')); if (lastReport) { const lastTimestamp = new Date(lastReport.timestamp).getTime(); const currentTime = Date.now();