<commit_before>'use strict';

const log = require('../logger');
const errors = require('storj-service-error-types');
const tmpl = '{"rate_limited": {"url": "%s", "method": "%s", "ip": "%s"}}';

module.exports.DEFAULTS = (total=1000, expire=1000*60) => {
  return {
    lookup: function(req) {
      return [req.headers['x-forwarded-for'] || req.connection.remoteAddress, req.route.path, req.method];
    },
    onRateLimited: function(req, res, next) {
      log.info(tmpl,
               req.originalUrl,
               req.method,
               req.headers['x-forwarded-for'] || req.connection.remoteAddress);
      return next(new errors.RateLimited('Too Many Requests'));
    },
    total,
    expire
  };
};<commit_msg>changes log.info to log.warn in limiter.js<commit_after>'use strict';

const log = require('../logger');
const errors = require('storj-service-error-types');
const tmpl = '{"rate_limited": {"url": "%s", "method": "%s", "ip": "%s"}}';

module.exports.DEFAULTS = (total=1000, expire=1000*60) => {
  return {
    lookup: function(req) {
      return [req.headers['x-forwarded-for'] || req.connection.remoteAddress, req.route.path, req.method];
    },
    onRateLimited: function(req, res, next) {
      log.warn(tmpl,
               req.originalUrl,
               req.method,
               req.headers['x-forwarded-for'] || req.connection.remoteAddress);
      return next(new errors.RateLimited('Too Many Requests'));
    },
    total,
    expire
  };
};
{'fraction_non_alphanumeric': 0.1832319134550372, 'fraction_numerical': 0.013522650439486139, 'mean_word_length': 3.0997229916897506, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7209711', 'n_tokens_mistral': 491, 'n_tokens_neox': 476, 'n_words': 93}