From 0070379c5c0a4e458bd9481ddd7b6d918919e9cd Mon Sep 17 00:00:00 2001 From: Sefinek Date: Thu, 5 Sep 2024 16:30:30 +0200 Subject: [PATCH] Some fixes --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 40cbb07..2538f7e 100644 --- a/index.js +++ b/index.js @@ -50,13 +50,13 @@ const isIPReportedRecently = (ip, reportedIPs) => { const reportIP = async (event, url, country, cycleErrorCounts) => { if (!url) { logToCSV(event.rayName, event.clientIP, url, 'Failed - Missing URL', country); - log('warn', `Error while reporting: ${event.clientIP}; URI: ${url}; (Missing URL)`); + log('warn', `Missing URL ${event.clientIP}; URI: ${url};`); return false; } if (url.length > MAX_URL_LENGTH) { logToCSV(event.rayName, event.clientIP, url, 'Failed - URL too long', country); - log('warn', `Error 422 while reporting: ${event.clientIP}; URI: ${url}; (URL too long)`); + log('log', `URL too long ${event.clientIP}; URI: ${url};`); return false; } @@ -68,16 +68,16 @@ const reportIP = async (event, url, country, cycleErrorCounts) => { }, { headers: headers.ABUSEIPDB }); logToCSV(event.rayName, event.clientIP, url, 'Reported', country); - log('info', `Reported: ${event.clientIP}; URI: ${url}`); + log('info', `Reported ${event.clientIP}; URI: ${url}`); return true; } catch (err) { if (err.response?.status === 429) { logToCSV(event.rayName, event.clientIP, url, 'Failed - 429 Too Many Requests', country); - log('info', `Rate limited (429) while reporting: ${event.clientIP}; URI: ${url};`); + log('info', `Rate limited (429) while reporting ${event.clientIP}; URI: ${url};`); cycleErrorCounts.blocked++; } else { - log('error', `Error ${err.response?.status} while reporting: ${event.clientIP}; URI: ${url}; (${err.response?.data})`); + log('error', `Error ${err.response?.status} while reporting ${event.clientIP}; URI: ${url}; (${err.response?.data})`); cycleErrorCounts.otherErrors++; }