Closed mlexs closed 3 years ago
Me thinks this exclusion should happen in the core module once the URL is matched and before it proceeds to look up user/group?
You can do it. Just like the follow code:
config={
r"^/api/find/germany": [Rule()],
r"^/api/find/belgium": [
Rule(minute=50, group="belgium")
],
...
}
Not giving any time parameter to Rule
means that the request restriction is lifted. And, RatelimitMiddleware
will use the first matched route, so you can use it first if you put the whitelist route in front of other routes.
I'm having a rather custom requirement to exclude (not count the rate limit) against certain URL paths.
For example given the endpoint
I'd like to exclude some paths then, e.g.:
I think it's not currently possible? After looking at the code.
Do you think such functionality could benefit other users?