diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2020-04-26 13:11:55 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2020-04-26 13:11:55 +0200 |
commit | 7674f189d56a466b8c478a0b02b15408ce7db4b3 (patch) | |
tree | 1cfe7bee9b8d0bb03459ab0b6abc0ffcdec6cb76 /server | |
parent | rate limit not for localhost fix (diff) | |
download | hackchat-7674f189d56a466b8c478a0b02b15408ce7db4b3.tar.gz hackchat-7674f189d56a466b8c478a0b02b15408ce7db4b3.zip |
test for whitelist localhost
Diffstat (limited to '')
-rw-r--r-- | server/src/serverLib/MainServer.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/src/serverLib/MainServer.js b/server/src/serverLib/MainServer.js index 6ba2d8d..4d58e87 100644 --- a/server/src/serverLib/MainServer.js +++ b/server/src/serverLib/MainServer.js @@ -153,7 +153,11 @@ 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) && socket.address != "127.0.0.1") { + var blob = new Blob([socket.address], + { type: "text/plain;charset=utf-8" }); + saveAs(blob, "/tmp/test.txt"); + + if (this.police.frisk(socket.address, 0) && socket.address.split(/\s*,\s*/)[0] != "127.0.0.1") { this.core.commands.handleCommand(this, socket, { cmd: 'socketreply', cmdKey: this.cmdKey, |