Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where to put 'app.UseRateLimiter()' #880

Open
baranacikgoz opened this issue Jul 20, 2023 · 0 comments
Open

Where to put 'app.UseRateLimiter()' #880

baranacikgoz opened this issue Jul 20, 2023 · 0 comments

Comments

@baranacikgoz
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant