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 rate limits #57

Merged
merged 2 commits into from
Apr 10, 2024
Merged

fix rate limits #57

merged 2 commits into from
Apr 10, 2024

Conversation

dealloc
Copy link
Member

@dealloc dealloc commented Apr 10, 2024

currently rate limits are (once again) applied globally since the client IP address (which is used as the rate limit bucket) doesn't seem to be correctly set by the forwarded headers middleware.

tests indicate this is because it processes right to left, whereas Fly places the eventual client IP on the left.
so basically:
<client-ip>,<proxy-1>,<proxy-2> etc, and the app would only process <proxy-2> and never <client-ip> essentially enforcing a global rate limit per proxy region

this PR ensures that proxies are correctly processed, which in turn should fix the rate limit

@dealloc dealloc added the bug Something isn't working label Apr 10, 2024
@dealloc dealloc added this to the V1 milestone Apr 10, 2024
@dealloc dealloc requested a review from a team April 10, 2024 11:45
@dealloc dealloc self-assigned this Apr 10, 2024
Copy link
Contributor

@chatterchats chatterchats left a comment

Choose a reason for hiding this comment

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

Looks good, simple implementation, but simple sometimes works best. Approved.

@chatterchats chatterchats merged commit 5275c57 into master Apr 10, 2024
1 check passed
@chatterchats chatterchats deleted the fix/rate-limit branch April 10, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants