Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

express-rate-limit

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-rate-limit - npm Package Compare versions

Comparing version 5.4.1 to 5.5.0

4

lib/express-rate-limit.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc