From d92fc149916e79f29bb7b530af84e721af590afc Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 26 Aug 2024 17:13:48 +0200 Subject: [PATCH] Remove listenerEmitted flag from HTTP authentication message callback --- src/middleware/nonStandardCodesAndHttpAuthentication.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/middleware/nonStandardCodesAndHttpAuthentication.js b/src/middleware/nonStandardCodesAndHttpAuthentication.js index c3a7724..09ed50b 100644 --- a/src/middleware/nonStandardCodesAndHttpAuthentication.js +++ b/src/middleware/nonStandardCodesAndHttpAuthentication.js @@ -406,14 +406,10 @@ module.exports = (req, res, logFacilities, config, next) => { logFacilities.errmessage("Brute force limit reached!"); } } else { - var listenerEmitted = false; - // Listen for brute-force protection response const authMessageListener = (message) => { - if (listenerEmitted) return; if (message == "\x14AUTHA" + reqip || message == "\x14AUTHD" + reqip) { process.removeListener("message", authMessageListener); - listenerEmitted = true; } if (message == "\x14AUTHD" + reqip) { res.error(429);