Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions backend/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from datetime import timedelta

MINIMUM_PASSWORD_LENGTH = 5
MAXIMUM_BLOOM_LENGTH = 280


def login():
Expand Down Expand Up @@ -155,11 +156,18 @@ def send_bloom():
type_check_error = verify_request_fields({"content": str})
if type_check_error is not None:
return type_check_error

if len(request.json["content"]) > MAXIMUM_BLOOM_LENGTH:
return make_response(
(
{
"success": False,
"message": f"Bloom must be no more than {MAXIMUM_BLOOM_LENGTH} characters long",
},
400,
)
)
user = get_current_user()

blooms.add_bloom(sender=user, content=request.json["content"])

return jsonify(
{
"success": True,
Expand Down
15 changes: 15 additions & 0 deletions backend/flask.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* Serving Flask app 'PurpleForest'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:3000
* Running on http://192.168.68.101:3000
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: 409-212-381
127.0.0.1 - - [03/Jul/2026 00:00:23] "POST /login HTTP/1.1" 200 -
127.0.0.1 - - [03/Jul/2026 00:01:36] "POST /bloom HTTP/1.1" 400 -
127.0.0.1 - - [03/Jul/2026 00:01:45] "POST /bloom HTTP/1.1" 200 -
127.0.0.1 - - [03/Jul/2026 00:02:35] "POST /bloom HTTP/1.1" 200 -
127.0.0.1 - - [03/Jul/2026 00:02:42] "POST /bloom HTTP/1.1" 400 -