Skip to content

Commit

Permalink
docs: current -> used & a note for express-slow-down users
Browse files Browse the repository at this point in the history
  • Loading branch information
nfriedly committed Nov 15, 2023
1 parent 039b49d commit 3ea29e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/reference/error-codes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,16 @@ handler like so:
const limiter = rateLimit({
// ...
handler: (request, response, next, options) => {
if (request.rateLimit.current === request.rateLimit.limit + 1) {
if (request.rateLimit.used === request.rateLimit.limit + 1) {
// onLimitReached code here
}
response.status(options.statusCode).send(options.message)
},
})
```

([Alternatives for `express-slow-down` users](https://github.com/express-rate-limit/express-slow-down/issues/45#issuecomment-1813098848))

Set `validate: {onLimitReached: false}` in the options to disable the check.

### `WRN_ERL_DEPRECATED_DRAFT_POLLI_HEADERS`
Expand Down

0 comments on commit 3ea29e4

Please sign in to comment.