Update app.py
Browse files
app.py
CHANGED
|
@@ -746,6 +746,13 @@ def cleanup_expired():
|
|
| 746 |
def create_chat_room():
|
| 747 |
|
| 748 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 749 |
|
| 750 |
form = request.form
|
| 751 |
ttl = int(form.get("ttl", 3600))
|
|
|
|
| 746 |
def create_chat_room():
|
| 747 |
|
| 748 |
try:
|
| 749 |
+
session_uuid = request.form.get("session_uuid")
|
| 750 |
+
if session_uuid:
|
| 751 |
+
allowed, message = check_rate_limit(
|
| 752 |
+
session_uuid, limit=5, window_seconds=60
|
| 753 |
+
)
|
| 754 |
+
if not allowed:
|
| 755 |
+
return jsonify({"error": message}), 429
|
| 756 |
|
| 757 |
form = request.form
|
| 758 |
ttl = int(form.get("ttl", 3600))
|