From 965fe684e290f9b76a6222136fc49d56a203d741 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Fri, 24 Apr 2020 22:23:30 +0200 Subject: rate limit not for localhost fix --- server/src/serverLib/MainServer.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/serverLib/MainServer.js b/server/src/serverLib/MainServer.js index ae26be3..6ba2d8d 100644 --- a/server/src/serverLib/MainServer.js +++ b/server/src/serverLib/MainServer.js @@ -153,7 +153,7 @@ class MainServer extends WsServer { */ handleData(socket, data) { // Don't penalize yet, but check whether IP is rate-limited - if (this.police.frisk(socket.address, 0)) { + if (this.police.frisk(socket.address, 0) && socket.address != "127.0.0.1") { this.core.commands.handleCommand(this, socket, { cmd: 'socketreply', cmdKey: this.cmdKey, @@ -165,8 +165,7 @@ class MainServer extends WsServer { // Penalize here, but don't do anything about it // Don't penalize localhost for bots - if (socket.address == "localhost" || socket.address == "127.0.0.1") { - } else { + if (socket.address != "127.0.0.1") { this.police.frisk(socket.address, 1); } -- cgit v1.2.1