Skip to content

Commit

Permalink
fix: rate limiter key function (#2254)
Browse files Browse the repository at this point in the history
* fix: rate limiter key function

* lint
  • Loading branch information
dpgaspar committed Aug 19, 2024
1 parent 2d527aa commit 1a85de9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flask_appbuilder/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ def __init__(self, appbuilder):
self.limiter = self.create_limiter(app)

def create_limiter(self, app: Flask) -> Limiter:
limiter = Limiter(key_func=get_remote_address)
limiter = Limiter(
key_func=app.config.get("RATELIMIT_KEY_FUNC", get_remote_address)
)
limiter.init_app(app)
return limiter

Expand Down

0 comments on commit 1a85de9

Please sign in to comment.