express-rate-limit
Advanced tools
Comparing version 2.7.0 to 2.8.0
@@ -32,3 +32,4 @@ 'use strict'; | ||
}); | ||
} | ||
}, | ||
onLimitReached: function(/*req, res, optionsUsed*/) {} | ||
}); | ||
@@ -75,2 +76,3 @@ | ||
if (options.max && current > options.max) { | ||
options.onLimitReached(req, res, options); | ||
return options.handler(req, res, next); | ||
@@ -77,0 +79,0 @@ } |
{ | ||
"name": "express-rate-limit", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/nfriedly/express-rate-limit", |
@@ -119,2 +119,8 @@ # Express Rate Limit | ||
``` | ||
* **onLimitReached**: Function to listen each time the limit is reached. You can use it to debug/log. Defaults: | ||
```js | ||
function (req, res, options) { | ||
/* empty */ | ||
} | ||
``` | ||
* **store**: The storage to use when persisting rate limit attempts. By default, the [MemoryStore](lib/memory-store.js) is used. It must implement the following in order to function: | ||
@@ -121,0 +127,0 @@ ```js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12450
98
181