You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
timeToExpire value returned from the increment function is in milliseconds instead of seconds. Because of that NestJs ThrottlerGuard sets the wrong Retry-After header in the HTTP response when the throttling limit is hit.
From the quick debug session, it looks like calling the PTTL Redis command returns milliseconds that are not converted to seconds afterwards.
The text was updated successfully, but these errors were encountered:
I can confirm this issue. The content of the Retry-After header is incorrect. It should contain seconds, while in practice it contains milliseconds. I think we should convert millis to seconds here right before we return the result to the guard.
Hi. Thanks a lot for noticing this, unfortunately this became a problem during the big rewrite last time. The tests did check for a number, but not a specific number. I've modified tests to make sure the secs are beings checked to make sure this won't happen again in the future.
I've just released this immediately under v0.3.2 on NPM.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
timeToExpire
value returned from theincrement
function is in milliseconds instead of seconds. Because of that NestJsThrottlerGuard
sets the wrongRetry-After
header in the HTTP response when the throttling limit is hit.From the quick debug session, it looks like calling the PTTL Redis command returns milliseconds that are not converted to seconds afterwards.
The text was updated successfully, but these errors were encountered: