-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Prevent accepted rate limits with no remaining token to be preferred over denied ones #47283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
462eb1d
to
77949f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the blazing fast bug fix, @MatTheCat!
Can you please add a test case for this fix, so we can be sure not to break it in the future?
src/Symfony/Component/HttpFoundation/RateLimiter/AbstractRequestRateLimiter.php
Outdated
Show resolved
Hide resolved
@wouterj thanks! What should I do to make my test pass? Seems my changes are missing from them 🤔 |
751caf4
to
d07c9ea
Compare
See https://symfony.com/doc/current/contributing/code/pull_requests.html#automated-tests for more information about our test suite. The failing checks are checking each individual package, rather than the monorepo. So it'll download rate limiter in the current available version, rather than the version of your PR. Ideally, we would have a test for this abstract class' behavior in the HttpFoundation component itself. If you have some time, it would be great to create a |
9ef5695
to
311c53b
Compare
Okay, remaining failures seem unrelated 👌 |
311c53b
to
9cc17e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
… to be preferred over denied ones
Thank you @MatTheCat. |
When a rate limit is first accepted with no remaining token, following rejected rate limits will be ignored because they also will have no remaining token. The request would then be processed.