From e0cd46d19bc6d3f71d398910c1fdf51d712a1161 Mon Sep 17 00:00:00 2001 From: iswat Date: Thu, 11 Jun 2026 14:58:48 +0100 Subject: [PATCH 1/2] Add 280-character limit validation for blooms --- backend/endpoints.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/endpoints.py b/backend/endpoints.py index 0e177a07..0773d578 100644 --- a/backend/endpoints.py +++ b/backend/endpoints.py @@ -18,6 +18,7 @@ from datetime import timedelta MINIMUM_PASSWORD_LENGTH = 5 +MAX_BLOOM_LENGTH = 280 def login(): @@ -158,6 +159,16 @@ def send_bloom(): user = get_current_user() + if len(request.json["content"]) > MAX_BLOOM_LENGTH: + return make_response( + ( + { + "success": False, + "message": f"Bloom must be less than {MAX_BLOOM_LENGTH} characters long", + }, + 400 + ) + ) blooms.add_bloom(sender=user, content=request.json["content"]) return jsonify( From 0847df9d5176c4a3e2bb2b1f0c028cd3e4513516 Mon Sep 17 00:00:00 2001 From: iswat Date: Thu, 25 Jun 2026 19:53:33 +0100 Subject: [PATCH 2/2] fix: clarify bloom length error message wording Updated the validation error message from "less than" to "not exceed". This ensures the text accurately reflects the backend logic, which allows blooms of exactly 280 characters while rejecting 281+. --- backend/endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/endpoints.py b/backend/endpoints.py index 0773d578..0e6ef056 100644 --- a/backend/endpoints.py +++ b/backend/endpoints.py @@ -164,7 +164,7 @@ def send_bloom(): ( { "success": False, - "message": f"Bloom must be less than {MAX_BLOOM_LENGTH} characters long", + "message": f"Bloom must not exceed {MAX_BLOOM_LENGTH} characters", }, 400 )