Closed erettozi closed 1 year ago
Note that the steps to reproduce does not have a way to generate/show the problem you are describing.
Anyhow, a PR to fix this would be highly welcomed.
Some users were experiencing throttling even for legitimate traffic (below 20 requests/minute - so below the 80 threshold in my case).
Make sure if you're using a proxy in production (most likely!) that trustProxy is properly set up, I had the exact same problem and it's not because of a bug in the code but rather because Fastify thinks only one IP is making the requests and applies rate limiting
Prerequisites
Fastify version
4.18.0
Plugin version
8.0.1
Node.js version
18.16.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Debian GNU/Linux 11 (bullseye)
Description
The problem appears to be caused by a bug in the redis implementation of the
@fastify/rate-limit
plugin. When the optioncontinueExceeding=true
, the operation does not work as expected. Some users were experiencing throttling even for legitimate traffic (below 20 requests/minute - so below the 80 threshold in my case).There is probably a BUG here: fastify-rate-limit/store/RedisStore.js
Steps to Reproduce
Expected Behavior
When
continueExceeding=true
, renew user limitation when user sends a request to the server when still limited