alisaifee / flask-limiter

Rate Limiting extension for Flask

Home Page:https://flask-limiter.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Override 429 status code based on condition

abhinavgurung opened this issue · comments

This is a Question.
I have a scenario where, when the rate limit is hit and another request is made which requires authentication. I would like to send 401 instead of 429. As of now, even though I raise 401 in my code, flask limiter is sending 429.
Is there a way to achieve this.

Thanks

You could use the on_breach hook as documented here

Closing due to inactivity.