add type check to reply id

This commit is contained in:
Mystikfluu
2022-07-27 17:53:08 +02:00
parent 85b8754b85
commit a31a39cf9c
+5
View File
@@ -578,6 +578,11 @@ router.post("/api/post", async function(req,res) {
reply_id = req.body.reply_id
}
if((typeof req.body.reply_id) != "number") {
res.json({"error":"no valid reply id given"})
return
}
if(req.body.message.length > 1000) {
res.json({"error":"message too long"})
return