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

fix: after should show the same ttl as the rate limit headers #394

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

gurgunday
Copy link
Member

@gurgunday gurgunday commented Nov 16, 2024

Simplifies the rate limiter by only looking at the ttl to construct the after message — this aligns the message with the Retry-After header; before, it would just send the timeWindow, which is inaccurate

So even if a user had 5 seconds left, if the timeWindow was 50 seconds, the error would say, "Retry in 50 seconds" and not "Retry in 5 seconds"

@gurgunday gurgunday requested a review from a team November 16, 2024 15:38
@gurgunday
Copy link
Member Author

I will rebase after #393 merges

Copy link
Member

@zekth zekth left a comment

Choose a reason for hiding this comment

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

✌️

Copy link
Member

@dancastillo dancastillo left a comment

Choose a reason for hiding this comment

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

LGTM

@gurgunday gurgunday merged commit 8b2b54d into master Nov 17, 2024
22 checks passed
@gurgunday gurgunday deleted the fix-timewindow branch November 17, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants