From ae59b9db719e9380390b8e11b1308c8dddb2b6c7 Mon Sep 17 00:00:00 2001 From: Victor Kuo <42633156+vck3000@users.noreply.github.com> Date: Fri, 3 Jan 2025 19:08:01 +1100 Subject: [PATCH] Don't allow Percies to do full IP ban (#729) * Percy ban * Percy can't blanket ip ban --- src/routes/mod.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/routes/mod.js b/src/routes/mod.js index e9e4d18d..2387660b 100644 --- a/src/routes/mod.js +++ b/src/routes/mod.js @@ -130,6 +130,11 @@ router.post('/ban', async (req, res) => { ipsToBan = banUser.IPAddresses; } + // Safety mechanism. Don't allow percies to do the full IP ban. + if (userIsPercy) { + ipsToBan = banUser.lastIPAddress; + } + // Get duration for ban: const now = new Date(); const whenMade = new Date();