add type check to reply id
This commit is contained in:
parent
85b8754b85
commit
a31a39cf9c
@ -578,6 +578,11 @@ router.post("/api/post", async function(req,res) {
|
|||||||
reply_id = req.body.reply_id
|
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) {
|
if(req.body.message.length > 1000) {
|
||||||
res.json({"error":"message too long"})
|
res.json({"error":"message too long"})
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user