express-rate-limit
Advanced tools
Comparing version 5.4.1 to 5.5.0
@@ -31,3 +31,3 @@ "use strict"; | ||
}, | ||
handler: function (req, res /*, next*/) { | ||
handler: function (req, res /*, next, optionsUsed*/) { | ||
res.status(options.statusCode).send(options.message); | ||
@@ -168,3 +168,3 @@ }, | ||
} | ||
return options.handler(req, res, next); | ||
return options.handler(req, res, next, options); | ||
} | ||
@@ -171,0 +171,0 @@ |
{ | ||
"name": "express-rate-limit", | ||
"version": "5.4.1", | ||
"version": "5.5.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", |
@@ -190,3 +190,3 @@ # Express Rate Limit | ||
The function to handle requests once the max limit is exceeded. It receives the request and the response objects. The "next" param is available if you need to pass to the next middleware. | ||
The function to handle requests once the max limit is exceeded. It receives the request and the response objects. The "next" param is available if you need to pass to the next middleware. Finally, the options param has all of the options that originally passed in when creating the current limiter and the default values for other options. | ||
@@ -198,3 +198,3 @@ The`req.rateLimit` object has `limit`, `current`, and `remaining` number of requests and, if the store provides it, a `resetTime` Date object. | ||
```js | ||
function (req, res, /*next*/) { | ||
function (req, res, next, options) { | ||
res.status(options.statusCode).send(options.message); | ||
@@ -201,0 +201,0 @@ } |
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
21790