Replies: 1 comment 2 replies
-
|
@Fdavidtr Good catch! Would |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The current documentation shows an example where the
X-RateLimit-Resetheader is set using aDateobject:This results in a string like:
However, this is not aligned with common practices. Most APIs (e.g. GitHub, Stripe, Twitter) return
X-RateLimit-Resetas a Unix timestamp in seconds — not a formatted date string.❌ Why this is problematic
Datestring breaks compatibility with clients expecting numeric values (e.g. retry logic likesetTimeout(Number(reset) - Date.now())fails).✅ Suggested fix in the docs
Update the example to use:
This way, the header is:
📚 References
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions