Skip to content
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

[5.2] Fixed the remaining attempts calculation #13756

Merged
merged 1 commit into from
May 29, 2016
Merged

[5.2] Fixed the remaining attempts calculation #13756

merged 1 commit into from
May 29, 2016

Conversation

GrahamCampbell
Copy link
Member

I'm not sure why we're not already using the retriesLeft method on the rate limiter object and were duplicating that code. I've changed the middleware to call that method.

I've also forced it to say 0 attempts remaining if we've bust the rate limit, instead of giving 101, if the limit was 100, for example.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@taylorotwell taylorotwell merged commit 35a5d64 into 5.2 May 29, 2016
{
return $maxAttempts - $this->limiter->attempts($key) + 1;
if ($retryAfter) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we actually trying to check here? That it is greater than 0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking if it's null or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make it more strict, one sec...

@GrahamCampbell GrahamCampbell deleted the throttle branch May 29, 2016 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants