Skip to content

Commit

Permalink
Merge 6b0fe35 into d9dec22
Browse files Browse the repository at this point in the history
  • Loading branch information
gwicke committed Jun 1, 2016
2 parents d9dec22 + 6b0fe35 commit be7f202
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions lib/filters/ratelimit_route.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ module.exports = function(hyper, req, next, options, specInfo) {

var key = pathKey + '|' + hyper._rootReq.headers['x-client-ip'];
if (hyper.ratelimiter.isAboveLimit(key, options.limits[requestClass])) {
if (options.log_only) {
hyper.log('warn/ratelimit/' + pathKey, {
key: key,
rate_limit_per_second: options.limits[requestClass],
message: 'Rate limit exceeded'
});
} else {
hyper.log('warn/ratelimit/' + pathKey, {
key: key,
rate_limit_per_second: options.limits[requestClass],
message: 'Rate limit exceeded'
});
if (!options.log_only) {
throw new HTTPError({
status: 429,
body: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hyperswitch",
"version": "0.5.1",
"version": "0.5.2",
"description": "REST API creation framework",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit be7f202

Please sign in to comment.