Skip to content

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

Merged
gurgunday merged 2 commits intomasterfrom
fix-timewindow
Nov 17, 2024
Merged

fix: after should show the same ttl as the rate limit headers#394
gurgunday merged 2 commits intomasterfrom
fix-timewindow

Conversation

@gurgunday
Copy link
Copy Markdown
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
Copy Markdown
Member Author

I will rebase after #393 merges

Copy link
Copy Markdown
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
Copy Markdown
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
@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