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

Can the window parameter be 0? #141

Open
Acconut opened this issue Nov 5, 2024 · 2 comments
Open

Can the window parameter be 0? #141

Acconut opened this issue Nov 5, 2024 · 2 comments

Comments

@Acconut
Copy link

Acconut commented Nov 5, 2024

According to https://www.ietf.org/archive/id/draft-ietf-httpapi-ratelimit-headers-08.html#name-window-parameter, the window parameter is a non-negative integer, meaning that it can also be 0. Does it make sense to have a window size of 0 seconds? Should this be allowed or should we require it to be greater than 0?

@ioggstream
Copy link
Collaborator

iirc the rationale was that w should be compatible with delay-seconds https://datatracker.ietf.org/doc/html/rfc9110#section-10.2.3-4

This could be reconsidered, though I remember we (long time ago) used non-negative intentionally :)

@Acconut
Copy link
Author

Acconut commented Nov 12, 2024

iirc the rationale was that w should be compatible with delay-seconds https://datatracker.ietf.org/doc/html/rfc9110#section-10.2.3-4

The Retry-After fields appears more similar to the t from RateLimit. For that it makes sense to have 0 as a value, so a client can retry as soon as possible. My comment above was referring to the w from RateLimit-Policy, which identifies the time window of the policy. Are there use cases for empty time windows?

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

No branches or pull requests

2 participants