express-rate-limit 5.4.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/express-rate-limit.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,11 @@ function RateLimit(options) {
|
|
|
18
18
|
skipSuccessfulRequests: false, // Do not count successful requests
|
|
19
19
|
// allows to create custom keys (by default user IP is used)
|
|
20
20
|
keyGenerator: function (req /*, res*/) {
|
|
21
|
+
if (!req.ip) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
"express-rate-limit: req.ip is undefined - are you sure you're using express?"
|
|
24
|
+
);
|
|
25
|
+
}
|
|
21
26
|
return req.ip;
|
|
22
27
|
},
|
|
23
28
|
skip: function (/*req, res*/) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-rate-limit",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.1",
|
|
4
4
|
"description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.",
|
|
5
5
|
"homepage": "https://github.com/nfriedly/express-rate-limit",
|
|
6
6
|
"author": {
|