From ad7d1a53d92cd1b227a83add07e8909d4914ce47 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Fri, 15 May 2020 19:14:30 -0400 Subject: [PATCH] Added string check to getIP --- src/utils/getIP.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/getIP.js b/src/utils/getIP.js index e8d0c26..469c705 100644 --- a/src/utils/getIP.js +++ b/src/utils/getIP.js @@ -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; } -} \ No newline at end of file +}