mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Limit message length
This commit is contained in:
@@ -34,6 +34,12 @@ async def send_message(
|
||||
detail="No content provided"
|
||||
)
|
||||
|
||||
if len(request.content.strip()) > 4096:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="Message too long"
|
||||
)
|
||||
|
||||
new_message = Message(
|
||||
content=request.content.strip(),
|
||||
user_id=current_user.id,
|
||||
|
||||
Reference in New Issue
Block a user