Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function (req) {
}
```

A function that allows you to switch how rate identifies a route. By fefault, its the method:route_regex
A function that allows you to switch how rate identifies a route. By default, its the method:route_regex

- *setHeaders*

Expand Down Expand Up @@ -96,7 +96,7 @@ function (req, res, rate, limit, resetTime) {
function (req, res, rate, limit, resetTime, next) {

// HTTP code 420 from http://mehack.com/inventing-a-http-response-code-aka-seriously
res.json({error: 'Rate limit exceeded. Check headers for limit information.'}, {status: 420});
res.json({error: 'Rate limit exceeded. Check headers for limit information.'}, 420);
}
```

Expand Down
2 changes: 1 addition & 1 deletion examples/simple-redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ var headersMiddleware = rate.middleware(
onLimitReached: function (req, res, rate, limit, resetTime, next) {

// HTTP code 420 from http://mehack.com/inventing-a-http-response-code-aka-seriously
res.json({error: 'Rate limit exceeded. Check headers for limit information.'}, {status: 420});
res.json({error: 'Rate limit exceeded. Check headers for limit information.'}, 420);
}
});

Expand Down