chore: update to latest fastapi (#2240)

security alert https://github.com/lnbits/lnbits/security/dependabot/46
This commit is contained in:
dni ⚡
2024-02-06 11:47:36 -03:00
committed by GitHub
parent 59968e38d1
commit c8e5c23ac2
4 changed files with 30 additions and 46 deletions
+6 -1
View File
@@ -187,7 +187,12 @@ class ExtensionsRedirectMiddleware:
def add_ratelimit_middleware(app: FastAPI):
core_app_extra.register_new_ratelimiter()
app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler)
# latest https://slowapi.readthedocs.io/en/latest/
# shows this as a valid way to add the handler
app.add_exception_handler(
RateLimitExceeded,
_rate_limit_exceeded_handler, # type: ignore
)
app.add_middleware(SlowAPIMiddleware)