Fixed AgentPort server crash.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-23 16:24:05 -07:00
parent a5b22f6085
commit b61082d3fd
1 changed files with 2 additions and 2 deletions

View File

@ -4093,9 +4093,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
) {
if (req.headers['cf-connecting-ip']) { // Use CloudFlare IP address if present
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();
} else if (res.headers['x-real-ip']) {
} else if (req.headers['x-real-ip']) {
req.clientIp = req.headers['x-real-ip'].split(',')[0].trim();
} else {
req.clientIp = ipex;