[X] I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
A proposal to modify the behavior of rate limit errors.
Since v4, fastify-sensible no longer has the error handler that sets the reply code automatically; fastify-multipart doesn't set it either when the Content Too Large error is thrown for instance — they only set the error.statusCode, throw, and let the dev decide what to do with that information.
Currently, rate-limit sets the reply code as well as the error code and it breaks things like reply.redirect("/") calls in the error handler that don't specify a redirect code.
It's not a huge issue, but a minor inconsistency between plugins IMO.
Prerequisites
🚀 Feature Proposal
A proposal to modify the behavior of rate limit errors.
Since v4,
fastify-sensible
no longer has the error handler that sets the reply code automatically;fastify-multipart
doesn't set it either when the Content Too Large error is thrown for instance — they only set theerror.statusCode
, throw, and let the dev decide what to do with that information.Currently,
rate-limit
sets the reply code as well as the error code and it breaks things likereply.redirect("/")
calls in the error handler that don't specify a redirect code.It's not a huge issue, but a minor inconsistency between plugins IMO.
What do you think?
Motivation
No response
Example
No response