From f4f5fac6c70b72579874f5c96f18cdb9166ea9bd Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Sun, 13 Mar 2022 09:11:12 -0600 Subject: [PATCH] Enforce 20 character limit in http --- frigate/http.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frigate/http.py b/frigate/http.py index 1e72c56a7..f21d1f8e6 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -168,6 +168,12 @@ def set_sub_label(id): new_sub_label = None + if new_sub_label and len(new_sub_label) > 20: + return make_response( + jsonify({"success": False, "message": new_sub_label + " exceeds the 20 character limit for sub_label"}), 400 + ) + + event.sub_label = new_sub_label event.save() return make_response(