flask-limiter icon indicating copy to clipboard operation
flask-limiter copied to clipboard

@limiter.exempt doesn't work with meta_limits

Open esledov opened this issue 11 months ago • 2 comments

I define a Limiter like this

limiter = Limiter(
        get_remote_address,
        app = app,
        meta_limits=["2 per 6 hours"],
        ...

and then trying to exempt a function


@app.route('/get_ip')
@limiter.exempt
def get_ip():

I assume, I should be able to get the ip address, but I am still receiving 429. When I remove meta_limits from Limiter, I can get the ip.

How do I properly exclude an endpoint from limitations for a limiter with defined meta_limits?

Thank you.

python 3.10.12 Flask-Limiter 3.5.1 Flask 2.2.2 on Ubuntu 20.04

esledov avatar Mar 04 '24 14:03 esledov

Yep this is a bug! Exemptions were not considered at all when implementing the meta limits.

alisaifee avatar Apr 21 '24 15:04 alisaifee

Resolved in 3.6.0

alisaifee avatar Apr 21 '24 22:04 alisaifee