1
0
Fork 0
forked from svrjs/svrjs

Add "localhost" entry to the block list, when "block localhost" is typed into SVR.JS rather than "::ffff:localhost".

This commit is contained in:
Dorian Niemiec 2024-03-17 15:13:07 +01:00
parent c85df7cd26
commit cb81658318

2
svr.js
View file

@ -5241,7 +5241,7 @@ function start(init) {
else if (!cluster.isPrimary) process.send("Cannot block non-existent IP."); else if (!cluster.isPrimary) process.send("Cannot block non-existent IP.");
} else { } else {
for (var i = 0; i < ip.length; i++) { for (var i = 0; i < ip.length; i++) {
if (ip[i].indexOf(":") == -1) { if (ip[i] != "localhost" && ip[i].indexOf(":") == -1) {
ip[i] = "::ffff:" + ip[i]; ip[i] = "::ffff:" + ip[i];
} }
if (!blocklist.check(ip[i])) { if (!blocklist.check(ip[i])) {