Closed bizley closed 6 years ago
You're not wrong :)
I have added rate limter config in our project but didn't get any below parameters in response headers X-Rate-Limit-Limit X-Rate-Limit-Remaining X-Rate-Limit-Reset Please any one guide me on this. How to implement ratelimiter in yii2.
Check 2 things (as in the guide):
If this not help please ask at the forum.
I suspect that method addRateLimitHeaders gets incorrect value for
$reset
argument resulting in incorrect headerX-Rate-Limit-Reset
value but I'm not sure of that because I can not believe no one noticed it for more than 3 years - please correct me if I'm wrong here.What steps will reproduce the problem?
Implement methods from
RateLimitInterface
like in docs.Set rate limit to
[2, 10]
(2 requests per 10 seconds).Send request and check headers.
What is the expected result?
X-Rate-Limit-Limit
= 2X-Rate-Limit-Remaining
= 1X-Rate-Limit-Reset
= 5What do you get instead?
X-Rate-Limit-Limit
= 2X-Rate-Limit-Remaining
= 1X-Rate-Limit-Reset
= 0Additional info
According to docs
X-Rate-Limit-Reset
is