[mirotalksfu] - fix
هذا الالتزام موجود في:
@@ -1983,13 +1983,14 @@ function startServer() {
|
|||||||
return req.headers['x-forwarded-for'] || req.socket.remoteAddress;
|
return req.headers['x-forwarded-for'] || req.socket.remoteAddress;
|
||||||
}
|
}
|
||||||
function allowedIP(ip) {
|
function allowedIP(ip) {
|
||||||
const allowedIPs = authHost.getAuthorizedIPs();
|
const authorizedIPs = authHost.getAuthorizedIPs();
|
||||||
log.info('Allowed IPs', { ip: ip, allowedIPs: allowedIPs });
|
const authorizedIP = authHost.isAuthorizedIP(ip);
|
||||||
return authHost != null && authHost.isAuthorizedIP(ip);
|
log.info('Allowed IPs', { ip: ip, authorizedIP: authorizedIP, authorizedIPs: authorizedIPs });
|
||||||
|
return authHost != null && authorizedIP;
|
||||||
}
|
}
|
||||||
function removeIP(socket) {
|
function removeIP(socket) {
|
||||||
if (hostCfg.protected) {
|
if (hostCfg.protected) {
|
||||||
let ip = socket.handshake.address;
|
const ip = socket.handshake.headers['x-forwarded-for'] || socket.handshake.address;
|
||||||
if (ip && allowedIP(ip)) {
|
if (ip && allowedIP(ip)) {
|
||||||
authHost.deleteIP(ip);
|
authHost.deleteIP(ip);
|
||||||
hostCfg.authenticated = false;
|
hostCfg.authenticated = false;
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم