loreanvictor/rxxpress

add a rateLimit() operator

Opened this issue · 0 comments

throttle() and throttleTime() operators work perfectly fine for rate-limiting, except that they ignore throttled requests altogether. this can be fixed with a timeout() with a custom return status, however thats a hacky solution.

instead, the neatest, most convenient solution would be to have a rateLimit() operator that acts exactly like throttle() but also responds to throttled requests with a 429 status code.