From 8a54834276b1df54690aeee876ee0f7e0c8bd25b Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 25 Aug 2024 09:25:06 +0200 Subject: [PATCH] Lint out the codebase. --- src/middleware/blocklist.js | 8 ++++---- src/middleware/nonStandardCodesAndHttpAuthentication.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) 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