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 · 4 comments · May be fixed by #146
Open

Can the window parameter be 0? #141

Acconut opened this issue Nov 5, 2024 · 4 comments · May be fixed by #146

Comments

@Acconut
Copy link
Contributor

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
Contributor 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?

@darrelmiller
Copy link
Contributor

@Acconut I think there are two ways to interpret w=0. It either means that the quota is replenished after zero time, and therefore there is effectively no quota. Or it means there is no reset window and so w=0 is equivalent to not providing a w parameter at all. This can be used for the "trial" scenario.

I suspect rather than have this ambiguity, we should just make the value a positive integer greater than zero.

@Acconut
Copy link
Contributor Author

Acconut commented Feb 24, 2025

I suspect rather than have this ambiguity, we should just make the value a positive integer greater than zero.

I agree. That makes more sense for such a document.

@darrelmiller darrelmiller moved this to Document Update Required in HttpApi Active Issues Mar 2, 2025
darrelmiller added a commit that referenced this issue Mar 2, 2025
@darrelmiller darrelmiller linked a pull request Mar 2, 2025 that will close this issue
@darrelmiller darrelmiller linked a pull request Mar 2, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Document Update Required
Development

Successfully merging a pull request may close this issue.

3 participants