nestjs/throttler

Add config flag to hide X-RateLimit- headers on response

SleepyMorpheus opened this issue · 0 comments

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Throttler response with both global and local rate-limiting usages as headers after a request. We don't want to expose our rate limiting settings to users.

Describe the solution you'd like

Add a config flag to the interface (like hideHeaders) that prevents the headers from being exposed.

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

It does not always make sense to expose the internal state of our application to the user. True, we could remove the headers again, but having a flag is the cleaner way.