You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
normalizedIp fix
This commit is contained in:
@@ -19,7 +19,8 @@ const { allPluginConfigs } = require('./plugins');
|
||||
// Endpoints
|
||||
router.get('/', (req, res) => {
|
||||
let requestIp = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
||||
const normalizedIp = requestIp.replace(/^::ffff:/, '');
|
||||
|
||||
const normalizedIp = requestIp?.replace(/^::ffff:/, '');
|
||||
const isBanned = serverConfig.webserver.banlist.some(banEntry => banEntry[0] === normalizedIp);
|
||||
|
||||
if (isBanned) {
|
||||
|
||||
Reference in New Issue
Block a user