Skip to content

Releases: express-rate-limit/express-rate-limit

v7.0.0

12 Sep 16:25
v7.0.0
1b6c5ef
Compare
Choose a tag to compare

Breaking

  • Changed behavior when max is set to 0:
    • Previously, max: 0 was treated as a 'disable' flag and would allow all requests through.
    • Starting with v7, all requests will be blocked when max is set to 0.
    • To replicate the old behavior, use the skip function instead.
  • Renamed req.rateLimit.current to req.rateLimit.used.
    • current is now a hidden getter that will return the used value, but it will not appear when iterating over the keys or calling JSON.stringify().
  • Changed the minimum required Node version from v14 to v16.
    • express-rate-limit now targets es2022 in TypeScript/ESBuild.
  • Bumped TypeScript from v4 to v5 and dts-bundle-generator from v7 to v8.

Deprecated

  • Removed the draft_polli_ratelimit_headers option (it was deprecated in v6).
    • Use standardHeaders: 'draft-6' instead.
  • Removed the onLimitReached option (it was deprecated in v6).
    • This is an example of how to replicate it's behavior with a custom handler option.

Changed

  • The MemoryStore now uses precise, per-user reset times rather than a global window that resets all users at once.
  • The limit configuration option is now prefered to max.
    • It still shows the same behavior, and max is still supported. The change was made to better align with terminology used in the IETF standard drafts.

Added

  • The validate config option can now be an object with keys to enable or disable specific validation checks. For more information, see this.

v6.11.2

12 Sep 02:02
Compare
Choose a tag to compare

Fixed

  • Restored IncrementResponse TypeScript type (See #397)

v6.11.1

10 Sep 17:10
08f936d
Compare
Choose a tag to compare

Fixed

  • Check for prefixed keys when validating that the stores have single counted keys (See #395).

v6.11.0

06 Sep 13:55
625ce86
Compare
Choose a tag to compare

Added

  • Support for retrieving the current hit count and reset time for a given key from a store (See #390).

v6.10.0

30 Aug 23:32
Compare
Choose a tag to compare

Added

  • Support for combined RateLimit header from the RateLimit header fields for HTTP standardization draft adopted by the IETF. Enable by setting standardHeaders: 'draft-7'
  • New standardHeaders: 'draft-6' option, treated equivalent to standardHeaders: true from previous releases. (true and false are still supported.)
  • New RateLimit-Policy header added when standardHeaders is set to 'draft-6', 'draft-7', or true
  • Warning when using deprecated draft_polli_ratelimit_headers option
  • Warning when using deprecated onLimitReached option
  • Warning when totalHits value returned from Store is invalid

v6.9.0

06 Aug 03:36
Compare
Choose a tag to compare

Added

  • New validaion check for double-counted requests
  • Added help link to each ValidationError, directing users to the appropriate wiki page for more info

Changed

  • Miscaleanous documenation improvements

You can view the full changelog here.

v6.8.1

27 Jul 13:09
Compare
Choose a tag to compare

Changed

  • Revert 6.7.1 change that bumped typescript from 5.x to 4.x and dts-bundle-generator from 8.x to 7.x (See #360)

You can view the full changelog here.

v6.7.2

27 Jul 12:59
Compare
Choose a tag to compare

(Backport of v6.8.1)

You can view the full changelog here.

v6.8.0

21 Jul 00:39
Compare
Choose a tag to compare

Added

You can view the changelog here.

v6.7.1

06 Jul 21:31
Compare
Choose a tag to compare

Fixed

  • Fixed compatibility with TypeScript's TypeScript new node16 module
    resolution strategy (See
    #355)

Changed

  • Bumped development dependencies.
  • Added node 20 to list of versions the CI jobs run on.

No functional changes.

You can view the changelog here.