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

Support ratelimit headers #629

Merged
merged 1 commit into from
Jan 12, 2024
Merged

Conversation

TheAwiteb
Copy link
Contributor

@TheAwiteb TheAwiteb commented Jan 12, 2024

resolve #626

  • Add add_headers field to the RateLimiter struct

  • Add add_headers function to the RateLimiter struct

  • Add X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers to the response if the add_headers is true

  • Add remaining, reset and limit functions to the RateGuard trait, to get the infos

- Add `add_headers` field to the `RateLimiter` struct
- Add `add_headers` function to the `RateLimiter` struct
- Add `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` headers to the response if the `add_headers` is true

- Add `remaining`, `reset` and `limit` functions to the `RateGuard` trait, to get the infos
@chrislearn chrislearn merged commit 7042b7a into salvo-rs:main Jan 12, 2024
7 checks passed
@TheAwiteb TheAwiteb deleted the add-ratelimit-headers branch January 12, 2024 08:57
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.

[Feature Request] Support for rate limiting headers
2 participants