Using rate limiter with before_request #442
Unanswered
andrii-korotkov-verkada
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey. I want to specify a configurable rate limit per various endpoints, but don't want to decorate every endpoint with limit decorator and still want to keep using @app.route to register endpoints and not writing a wrapper decorator.
Using a limiter in function decorate with before_request seems ideal, but I haven't found a straightforward way to do so.
Should I do something like this in a function with before_request decorator or is it a dumb idea?
Ideally, I'm looking for something like
limiter.apply_limit, a standalone function, not decorator.Can I achieve the goal with specifying callables in
default_limits?Thank you.
Beta Was this translation helpful? Give feedback.
All reactions