Replies: 1 comment
-
Sounds like a good idea, let's implement it!
I found #259 about the same.
I completely missed that :0 didn't have notifications on for that repo. I'll clone that branch and try to help too! |
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
-
Currently express-rate-limit disables itself when max is set to 0. I think we should change that to do the more obvious thing of just rate-limiting every request.
I think we should add a check to the validator in a minor release that just detects max=0 and warns that the behavior will be changing. Then put out a semver major release with the new behavior, and change the text of the validation message slightly to indicate that it has changed.
Right now validation shuts down after the first request, but this seems like another case where it might make sense to run for longer (if
max
is a function), so I may go and rework that as part of the process.For context: I've been working on converting express-slow-down to use express-rate-limit internally, and one thing I ran into is that while
delayAfter
andmax
are essentially the same thing, express-rate-limit disables itself when max is set to 0, whereas express-slow-down just does the more expected thing of slowing down right away. I can work around it, but I think it would be better not to.(I think there may have been some tickets around the behavior of max=0 surprising people, but I can't seem to find any now...)
Beta Was this translation helpful? Give feedback.
All reactions