Added string check to getIP

This commit is contained in:
Ajay Ramachandran
2020-05-15 19:14:30 -04:00
committed by GitHub
parent 9a317a2c23
commit ad7d1a53d9

View File

@@ -2,7 +2,7 @@ var fs = require('fs');
var config = require('../config.js');
module.exports = function getIP(req) {
if (config.behindProxy === true) config.behindProxy = "X-Forwarded-For";
if (config.behindProxy === true || config.behindProxy === "true") config.behindProxy = "X-Forwarded-For";
switch (config.behindProxy) {
case "X-Forwarded-For":
@@ -14,4 +14,4 @@ module.exports = function getIP(req) {
default:
return req.connection.remoteAddress;
}
}
}