Fix entry.action === 'TOO_MANY_REQUESTS'

This commit is contained in:
Sefinek 2024-09-10 17:28:30 +02:00
parent e961a77c4e
commit c2f3f89bc9

View file

@ -30,7 +30,7 @@ const fetchBlockedIPs = async () => {
}; };
const isIPReportedRecently = (ip, reportedIPs) => { 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) { if (lastReport) {
const lastTimestamp = new Date(lastReport.timestamp).getTime(); const lastTimestamp = new Date(lastReport.timestamp).getTime();
const currentTime = Date.now(); const currentTime = Date.now();