Changed getIP to be all lowercase

This commit is contained in:
Ajay Ramachandran
2020-05-17 01:38:15 -04:00
parent a2caa53664
commit 51f760332b

View File

@@ -1,4 +1,3 @@
var fs = require('fs');
var config = require('../config.js');
module.exports = function getIP(req) {
@@ -6,11 +5,11 @@ module.exports = function getIP(req) {
switch (config.behindProxy) {
case "X-Forwarded-For":
return req.headers['X-Forwarded-For'];
return req.headers['x-forwarded-for'];
case "Cloudflare":
return req.headers['CF-Connecting-IP'];
return req.headers['cf-connecting-ip'];
case "X-Real-IP":
return req.headers['X-Real-IP'];
return req.headers['x-real-ip'];
default:
return req.connection.remoteAddress;
}