...
|
...
|
@@ -20,7 +20,7 @@ const limiter = (rule, policy, context) => { |
|
|
|
|
|
module.exports = (req, res, next) => {
|
|
|
let remoteIp = req.get('X-Forwarded-For') || req.connection.remoteAddress;
|
|
|
logger.info('request remote ip: ', remoteIp);
|
|
|
logger.debug('request remote ip: ', remoteIp);
|
|
|
|
|
|
if (remoteIp.indexOf(',') > 0) {
|
|
|
let arr = remoteIp.split(',');
|
...
|
...
|
@@ -48,7 +48,7 @@ module.exports = (req, res, next) => { |
|
|
]).then((results) => {
|
|
|
let allPass = true, exclusion = false, policy = null;
|
|
|
|
|
|
logger.info('limiter result: ' + JSON.stringify(results));
|
|
|
logger.debug('limiter result: ' + JSON.stringify(results));
|
|
|
|
|
|
_.forEach(results, (result) => {
|
|
|
if (typeof result === 'object' && !exclusion) {
|
...
|
...
|
|