forked from svrjs/svrjs
Remove listenerEmitted flag from HTTP authentication message callback
This commit is contained in:
parent
5672c4a3d5
commit
d92fc14991
1 changed files with 0 additions and 4 deletions
|
@ -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);
|
||||
|
|
Reference in a new issue