Authored by 姜枫

fix startsWith bug

... ... @@ -20,7 +20,7 @@ const limiter = (rule, policy, context) => {
};
module.exports = (req, res, next) => {
let remoteIp = req.get('X-Forwarded-For') || req.connection.remoteAddress;
let remoteIp = req.get('X-Forwarded-For');
if (remoteIp.indexOf(',') > 0) {
let arr = remoteIp.split(',');
... ... @@ -30,7 +30,7 @@ module.exports = (req, res, next) => {
remoteIp = _.trim(remoteIp);
if (_.startWith(remoteIp, '10.66.')) {
if (_.startsWith(remoteIp, '10.66.')) {
remoteIp = req.get('X-Real-IP');
}
... ...