[mirotalksfu] - fix host protection mode

هذا الالتزام موجود في:
Miroslav Pejic
2024-04-10 14:30:03 +02:00
الأصل 14592af627
التزام 5bac95105f
5 ملفات معدلة مع 24 إضافات و10 حذوفات

عرض الملف

@@ -10,7 +10,8 @@ const allowedIPs = config.middleware ? config.middleware.IpWhitelist.allowed : [
const restrictAccessByIP = (req, res, next) => {
if (!IpWhitelistEnabled) return next();
//
const clientIP = req.headers['x-forwarded-for'] || req.socket.remoteAddress || req.ip;
const clientIP =
req.headers['x-forwarded-for'] || req.headers['X-Forwarded-For'] || req.socket.remoteAddress || req.ip;
log.debug('Check IP', clientIP);
if (allowedIPs.includes(clientIP)) {
next();