diff --git a/src/middleware/blocklist.js b/src/middleware/blocklist.js index 1b49353..4859f9b 100644 --- a/src/middleware/blocklist.js +++ b/src/middleware/blocklist.js @@ -18,7 +18,7 @@ module.exports = (req, res, logFacilities, config, next) => { }; module.exports.commands = { - block: (ip, logFacilities, passCommand) => { + block: (ip, log, passCommand) => { if (ip == undefined || JSON.stringify(ip) == "[]") { log("Cannot block non-existent IP."); } else { @@ -32,10 +32,10 @@ module.exports.commands = { } process.config.blacklist = blocklist.raw; log("IPs successfully blocked."); - passCommand(args, logFacilities); + passCommand(ip, log); } }, - unblock: (ip, logFacilities, passCommand) => { + unblock: (ip, log, passCommand) => { if (ip == undefined || JSON.stringify(ip) == "[]") { log("Cannot unblock non-existent IP."); } else { @@ -47,7 +47,7 @@ module.exports.commands = { } process.config.blacklist = blocklist.raw; log("IPs successfully unblocked."); - passCommand(args, logFacilities); + passCommand(ip, log); } }, }; diff --git a/src/middleware/nonStandardCodesAndHttpAuthentication.js b/src/middleware/nonStandardCodesAndHttpAuthentication.js index e570895..b57bed5 100644 --- a/src/middleware/nonStandardCodesAndHttpAuthentication.js +++ b/src/middleware/nonStandardCodesAndHttpAuthentication.js @@ -3,6 +3,7 @@ const sha256 = require("../utils/sha256.js"); const createRegex = require("../utils/createRegex.js"); const ipMatch = require("../utils/ipMatch.js"); const matchHostname = require("../utils/matchHostname.js"); +const ipBlockList = require("../utils/ipBlockList.js"); const cluster = require("../utils/clusterBunShim.js"); // Brute force protection-related