express-rate-limit 5.5.0 → 5.5.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 +4 -3
- package/lib/express-rate-limit.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Note: this module does not share state with other processes/servers by default.
|
|
|
17
17
|
- [Redis Store](https://npmjs.com/package/rate-limit-redis)
|
|
18
18
|
- [Memcached Store](https://npmjs.org/package/rate-limit-memcached)
|
|
19
19
|
- [Mongo Store](https://www.npmjs.com/package/rate-limit-mongo)
|
|
20
|
+
- [Precise Memory Store](https://www.npmjs.com/package/precise-memory-rate-limit) - similar to the built-in memory store except that it stores a distinct timestamp for each IP rather than bucketing them together.
|
|
20
21
|
|
|
21
22
|
### Alternate Rate-limiters
|
|
22
23
|
|
|
@@ -39,7 +40,7 @@ For an API-only server where the rate-limiter should be applied to all requests:
|
|
|
39
40
|
```js
|
|
40
41
|
const rateLimit = require("express-rate-limit");
|
|
41
42
|
|
|
42
|
-
// Enable if you're behind a reverse proxy (Heroku, Bluemix, AWS ELB, Nginx, etc)
|
|
43
|
+
// Enable if you're behind a reverse proxy (Heroku, Bluemix, AWS ELB or API Gateway, Nginx, etc)
|
|
43
44
|
// see https://expressjs.com/en/guide/behind-proxies.html
|
|
44
45
|
// app.set('trust proxy', 1);
|
|
45
46
|
|
|
@@ -57,7 +58,7 @@ For a "regular" web server (e.g. anything that uses `express.static()`), where t
|
|
|
57
58
|
```js
|
|
58
59
|
const rateLimit = require("express-rate-limit");
|
|
59
60
|
|
|
60
|
-
// Enable if you're behind a reverse proxy (Heroku, Bluemix, AWS ELB, Nginx, etc)
|
|
61
|
+
// Enable if you're behind a reverse proxy (Heroku, Bluemix, AWS ELB or API Gateway, Nginx, etc)
|
|
61
62
|
// see https://expressjs.com/en/guide/behind-proxies.html
|
|
62
63
|
// app.set('trust proxy', 1);
|
|
63
64
|
|
|
@@ -346,4 +347,4 @@ v2 uses a less precise but less resource intensive method of tracking hits from
|
|
|
346
347
|
|
|
347
348
|
## License
|
|
348
349
|
|
|
349
|
-
MIT © [Nathan Friedly](http://nfriedly.com/)
|
|
350
|
+
MIT © [Nathan Friedly](http://nfriedly.com/)
|
|
@@ -19,8 +19,8 @@ function RateLimit(options) {
|
|
|
19
19
|
// allows to create custom keys (by default user IP is used)
|
|
20
20
|
keyGenerator: function (req /*, res*/) {
|
|
21
21
|
if (!req.ip) {
|
|
22
|
-
|
|
23
|
-
"express-rate-limit: req.ip is undefined -
|
|
22
|
+
console.error(
|
|
23
|
+
"express-rate-limit: req.ip is undefined - you can avoid this by providing a custom keyGenerator function, but it may be indicative of a larger issue."
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
return req.ip;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-rate-limit",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.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": {
|