ip checking whitelist fix 2

This commit is contained in:
Ash
2023-02-18 20:17:35 +04:00
parent f24fd58710
commit a104082943

View File

@@ -106,8 +106,9 @@ app.use(function (req, res, next) { //Security
clientIp = ipv4;
} else {
clientIp = ip;
clientIp = clientIp.octets.join('.');
clientIp = clientIp.toString();
}
//clientIp = req.connection.remoteAddress.split(':').pop();
if (whitelistMode === true && !whitelist.includes(clientIp)) {
console.log('Forbidden: Connection attempt from '+ clientIp+'. If you are attempting to connect, please add your IP address in whitelist or disable whitelist mode in config.conf in root of TavernAI folder.\n');