Where to put 'app.UseRateLimiter()'
baranacikgoz opened this issue · comments
In which order to put app.UseRateLimiter()
?
I want to implement a rate limiter that is capable of knowing the current user, and allows applying different policies each endpoint in controllers.
I think it should be put after mapping controllers and also after authorization & authorization middlewares. But don't want to put it at the end, if the request should be declined, there is no need to execute unrelated middlewares, the execution pipeline should stop immediately. Where is the possibly earliest place to put app.UseRateLimiter()
?
I began to implement it, in the meantime you may suggest the middlewares order.