You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that the limiter.exempt is not working on /health route
Expected behavior
Limiter should be used for the health end poing
Your app (please complete the following information):
fastapi version 0.115.6
slowapi version 0.1.9
Additional context
The problem is in the function _find_route_handler which return the latest handler matching the route when fastapi is using the first
def _find_route_handler(
routes: Iterable[BaseRoute], scope: Scope
) -> Optional[Callable]:
handler = None
for route in routes:
match, _ = route.matches(scope)
if match == Match.FULL and hasattr(route, "endpoint"):
handler = route.endpoint # type: ignore
return handler
it should be changed by
def _find_route_handler(
routes: Iterable[BaseRoute], scope: Scope
) -> Optional[Callable]:
handler = None
for route in routes:
match, _ = route.matches(scope)
if match == Match.FULL and hasattr(route, "endpoint"):
handler = route.endpoint # type: ignore
break
return handler
The text was updated successfully, but these errors were encountered:
Describe the bug
The function _find_route_handler is not return the good route handler when using route with variable
To Reproduce
I have two route handler
The problem is that the limiter.exempt is not working on /health route
Expected behavior
Limiter should be used for the health end poing
Your app (please complete the following information):
Additional context
The problem is in the function _find_route_handler which return the latest handler matching the route when fastapi is using the first
it should be changed by
The text was updated successfully, but these errors were encountered: