Replies: 1 comment
-
I'm in favour of the in-built feature too. It makes more sense, especially since if we pass the If we want to pass the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've seen a number of questions like https://stackoverflow.com/questions/66352481/is-many-instances-of-express-rate-limit-going-to-cause-issues and https://stackoverflow.com/questions/69504697/express-rate-limit-for-login-route where someone would like to apply multiple rules at once. Also, if express-rate-limit and express-slow-down are used together, it would be good to allow sharing the store.
It should be possible to have the first instance hit the store and set the req.rateLimit property, and then have all subsequent instances check that property rather than also hitting their own store.
I initially thought this could just be a new store, but I don't think the current Store API provides this capability. So, we could either make it a built-in feature where it skips the store and uses the previous value, or we could update the Store API to provide a way to access the request (or at least the
req.rateLimit
property).I'm a little divided on the two, but I'm leaning slightly towards a built-in feature so that it could have on/off/auto and the auto setting would use
req.rateLimit
if present or fall back to the configuredstore
.Beta Was this translation helpful? Give feedback.
All reactions