mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-30 13:48:07 +02:00
Api fixes (#13955)
* Fix false positive submission * Make sure None is not sent as rate limit
This commit is contained in:
parent
a7f1f8d327
commit
e935db5075
@ -768,7 +768,7 @@ def false_positive(request: Request, event_id: str):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not event.plus_id:
|
if not event.plus_id:
|
||||||
plus_response = send_to_plus(event_id)
|
plus_response = send_to_plus(request, event_id)
|
||||||
if plus_response.status_code != 200:
|
if plus_response.status_code != 200:
|
||||||
return plus_response
|
return plus_response
|
||||||
# need to refetch the event now that it has a plus_id
|
# need to refetch the event now that it has a plus_id
|
||||||
|
@ -83,7 +83,7 @@ def create_fastapi_app(
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
# Rate limiter (used for login endpoint)
|
# Rate limiter (used for login endpoint)
|
||||||
auth.rateLimiter.set_limit(frigate_config.auth.failed_login_rate_limit)
|
auth.rateLimiter.set_limit(frigate_config.auth.failed_login_rate_limit or "")
|
||||||
app.state.limiter = limiter
|
app.state.limiter = limiter
|
||||||
app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler)
|
app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler)
|
||||||
app.add_middleware(SlowAPIMiddleware)
|
app.add_middleware(SlowAPIMiddleware)
|
||||||
|
Loading…
Reference in New Issue
Block a user