quart-rate-limiter icon indicating copy to clipboard operation
quart-rate-limiter copied to clipboard

default_limits ignores key_function

Open Quintenvw opened this issue 1 year ago • 1 comments

When using default_limits, it appears that the key_function is not being respected. This leads to unexpected behavior, as the rate limiting does not differentiate users based on the custom logic defined in the key_function.

Steps to Reproduce:

  1. Set up quart-rate-limiter with a relatively low rate limit in default_limits.
  2. Define a key_function to differentiate users.
  3. Observe that the rate limiting is applied universally, ignoring the distinctions made by key_function.

Suggested Solutions:

  1. If this behavior is not intended, which I assume it isn't, a small adjustment might be required to ensure default_limits respects the key_function.
  2. If the current behavior is by design, please update the README to clarify that default_limits doesn't respect key_function.

Thank you for your efforts in developing and maintaining quart-rate-limiter!

Best regards, Quintenvw

Quintenvw avatar Jan 20 '24 19:01 Quintenvw

I can't reproduce this, and I would expect the test_rate_limit_unique_keys test to fail if this was the case. Could you provide a snippet that reproduces?

pgjones avatar May 19 '24 09:05 pgjones