-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Throttler usage #827
Comments
The App::baseURL was set to http://localhost:8080/ |
No, those results don't match what we should expect. Using the default throttler it should allow 1 action per second, after the "bucket" has run out. So it should be doing:
The tests support this is how it should be working. I wonder if the IP results you're getting from CLI may be doing strange things since it's testing. |
First time, now, I thought that could be because the IP get was Changing the But adding the last param // entire site.
if ($throttler->check($request->getIPAddress(), 60, MINUTE, 60) === false)
{
return Services::response()->setStatusCode(429);
}
|
Of course, I believe that my test script must be only Then:
Before all tests was run |
...and the |
Hmm.. it sounds like it's partially working then. But I wonder if it's filling itself back up faster than it should.... |
Hi, I was testing requests by browser to see the throttler work. But do not occurs any 429 HTTP Code response.
Then I created a Command to test this...
To avoid CLI errors after enable the Global Before Filter throttle, I added this in the begging of the before method of the Throttle Filter:
And in the Home controller index just an
echo date('Y-m-d H:i:s');
to see the body get by the cURL.Then, testing in the terminal by 60 seconds I had the following result:
By 10 seconds the following:
My doubt is: Is "correct" have results like it?
The text was updated successfully, but these errors were encountered: