express-rate-limit 6.11.2 → 7.0.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/changelog.md +62 -15
- package/dist/index.cjs +260 -220
- package/dist/index.d.cts +169 -27
- package/dist/index.d.mts +169 -27
- package/dist/index.d.ts +169 -27
- package/dist/index.mjs +260 -222
- package/license.md +1 -1
- package/package.json +16 -16
- package/readme.md +92 -104
- package/tsconfig.json +4 -1
package/changelog.md
CHANGED
|
@@ -6,9 +6,56 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to
|
|
7
7
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [7.0.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v7.0.1)
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added `rate-limit-postgresql` to the `stores` list in the readme.
|
|
14
|
+
|
|
15
|
+
## [7.0.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v7.0.0)
|
|
16
|
+
|
|
17
|
+
### Breaking
|
|
18
|
+
|
|
19
|
+
- Changed behavior when `max` is set to 0:
|
|
20
|
+
- Previously, `max: 0` was treated as a 'disable' flag and would allow all
|
|
21
|
+
requests through.
|
|
22
|
+
- Starting with v7, all requests will be blocked when max is set to 0.
|
|
23
|
+
- To replicate the old behavior, use the
|
|
24
|
+
[skip](https://github.com/express-rate-limit/express-rate-limit#skip)
|
|
25
|
+
function instead.
|
|
26
|
+
- Renamed `req.rateLimit.current` to `req.rateLimit.used`.
|
|
27
|
+
- `current` is now a hidden getter that will return the `used` value, but it
|
|
28
|
+
will not appear when iterating over the keys or calling `JSON.stringify()`.
|
|
29
|
+
- Changed the minimum required Node version from v14 to v16.
|
|
30
|
+
- `express-rate-limit` now targets `es2022` in TypeScript/ESBuild.
|
|
31
|
+
- Bumped TypeScript from v4 to v5 and `dts-bundle-generator` from v7 to v8.
|
|
32
|
+
|
|
33
|
+
### Deprecated
|
|
34
|
+
|
|
35
|
+
- Removed the `draft_polli_ratelimit_headers` option (it was deprecated in v6).
|
|
36
|
+
- Use `standardHeaders: 'draft-6'` instead.
|
|
37
|
+
- Removed the `onLimitReached` option (it was deprecated in v6).
|
|
38
|
+
- [This](<(https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#wrn_erl_deprecated_on_limit_reached)>)
|
|
39
|
+
is an example of how to replicate it's behavior with a custom `handler`
|
|
40
|
+
option.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- The `MemoryStore` now uses precise, per-user reset times rather than a global
|
|
45
|
+
window that resets all users at once.
|
|
46
|
+
- The `limit` configuration option is now prefered to `max`.
|
|
47
|
+
- It still shows the same behavior, and `max` is still supported. The change
|
|
48
|
+
was made to better align with terminology used in the IETF standard drafts.
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
|
|
52
|
+
- The `validate` config option can now be an object with keys to enable or
|
|
53
|
+
disable specific validation checks. For more information, see
|
|
54
|
+
[this](https://github.com/express-rate-limit/express-rate-limit#validate).
|
|
55
|
+
|
|
9
56
|
## [6.11.2](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.11.2)
|
|
10
57
|
|
|
11
|
-
Fixed
|
|
58
|
+
### Fixed
|
|
12
59
|
|
|
13
60
|
- Restored `IncrementResponse ` TypeScript type (See
|
|
14
61
|
[#397](https://github.com/express-rate-limit/express-rate-limit/pull/397))
|
|
@@ -35,27 +82,27 @@ Fixed:
|
|
|
35
82
|
|
|
36
83
|
- Support for combined `RateLimit` header from the
|
|
37
84
|
[RateLimit header fields for HTTP standardization draft](https://github.com/ietf-wg-httpapi/ratelimit-headers)
|
|
38
|
-
adopted by the IETF. Enable by setting `standardHeaders: 'draft-7'
|
|
85
|
+
adopted by the IETF. Enable by setting `standardHeaders: 'draft-7'`.
|
|
39
86
|
- New `standardHeaders: 'draft-6'` option, treated equivalent to
|
|
40
|
-
`standardHeaders: true` from previous releases.
|
|
41
|
-
supported.
|
|
87
|
+
`standardHeaders: true` from previous releases. Note that `true` and `false`
|
|
88
|
+
are still supported.
|
|
42
89
|
- New `RateLimit-Policy` header added when `standardHeaders` is set to
|
|
43
|
-
`'draft-6'`, `'draft-7'`, or `true
|
|
44
|
-
- Warning when using deprecated `draft_polli_ratelimit_headers` option
|
|
45
|
-
- Warning when using deprecated `onLimitReached` option
|
|
46
|
-
- Warning when `totalHits` value returned from Store is invalid
|
|
90
|
+
`'draft-6'`, `'draft-7'`, or `true`.
|
|
91
|
+
- Warning when using deprecated `draft_polli_ratelimit_headers` option.
|
|
92
|
+
- Warning when using deprecated `onLimitReached` option.
|
|
93
|
+
- Warning when `totalHits` value returned from Store is invalid.
|
|
47
94
|
|
|
48
95
|
## [6.9.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.9.0)
|
|
49
96
|
|
|
50
97
|
### Added
|
|
51
98
|
|
|
52
|
-
- New validaion check for double-counted requests
|
|
53
|
-
- Added help link to each
|
|
54
|
-
wiki page for more info
|
|
99
|
+
- New validaion check for double-counted requests.
|
|
100
|
+
- Added help link to each validation error, directing users to the appropriate
|
|
101
|
+
wiki page for more info.
|
|
55
102
|
|
|
56
103
|
### Changed
|
|
57
104
|
|
|
58
|
-
-
|
|
105
|
+
- Miscellaneous documenation improvements.
|
|
59
106
|
|
|
60
107
|
## [6.8.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.8.0) & [6.7.2](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.8.0)
|
|
61
108
|
|
|
@@ -63,7 +110,7 @@ Fixed:
|
|
|
63
110
|
|
|
64
111
|
- Revert 6.7.1 change that bumped typescript from 5.x to 4.x and
|
|
65
112
|
dts-bundle-generator from 8.x to 7.x (See
|
|
66
|
-
[#360](https://github.com/express-rate-limit/express-rate-limit/issues/360))
|
|
113
|
+
[#360](https://github.com/express-rate-limit/express-rate-limit/issues/360)).
|
|
67
114
|
|
|
68
115
|
## [6.8.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.8.0)
|
|
69
116
|
|
|
@@ -73,7 +120,7 @@ Fixed:
|
|
|
73
120
|
https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes for
|
|
74
121
|
a list of potential errors. Can be disabled by setting `validate: false` in
|
|
75
122
|
the configuration. Automatically disables after the first request. (See
|
|
76
|
-
[#358](https://github.com/express-rate-limit/express-rate-limit/issues/358))
|
|
123
|
+
[#358](https://github.com/express-rate-limit/express-rate-limit/issues/358)).
|
|
77
124
|
|
|
78
125
|
## [6.7.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.7.1)
|
|
79
126
|
|
|
@@ -81,7 +128,7 @@ Fixed:
|
|
|
81
128
|
|
|
82
129
|
- Fixed compatibility with TypeScript's TypeScript new `node16` module
|
|
83
130
|
resolution strategy (See
|
|
84
|
-
[#355](https://github.com/express-rate-limit/express-rate-limit/issues/355))
|
|
131
|
+
[#355](https://github.com/express-rate-limit/express-rate-limit/issues/355)).
|
|
85
132
|
|
|
86
133
|
### Changed
|
|
87
134
|
|