redis-developer / redis-developer.github.io

The Home of Redis Developers
https://developer.redis.com
46 stars 142 forks source link

Fix off-by-one errors in rate limiting samples. #613

Open kimsey0 opened 10 months ago

kimsey0 commented 10 months ago

The scripts in the two samples increments then number of requests made, then checks if the result is less than the max allowed number of requests. This causes the last request to be denied incorrectly. This pull requests upgrades to the correct less-than-or-equal-to operator, matching the text. It also updates a sample output to have the correct number of allowed requests.