mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-25 21:53:14 -05:00
Fixed AgentPort server crash.
This commit is contained in:
parent
bee474a87d
commit
145f966ba7
@ -4093,9 +4093,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||||||
) {
|
) {
|
||||||
if (req.headers['cf-connecting-ip']) { // Use CloudFlare IP address if present
|
if (req.headers['cf-connecting-ip']) { // Use CloudFlare IP address if present
|
||||||
req.clientIp = req.headers['cf-connecting-ip'].split(',')[0].trim();
|
req.clientIp = req.headers['cf-connecting-ip'].split(',')[0].trim();
|
||||||
} else if (res.headers['x-forwarded-for']) {
|
} else if (req.headers['x-forwarded-for']) {
|
||||||
req.clientIp = req.headers['x-forwarded-for'].split(',')[0].trim();
|
req.clientIp = req.headers['x-forwarded-for'].split(',')[0].trim();
|
||||||
} else if (res.headers['x-real-ip']) {
|
} else if (req.headers['x-real-ip']) {
|
||||||
req.clientIp = req.headers['x-real-ip'].split(',')[0].trim();
|
req.clientIp = req.headers['x-real-ip'].split(',')[0].trim();
|
||||||
} else {
|
} else {
|
||||||
req.clientIp = ipex;
|
req.clientIp = ipex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user