add minimum length for content

This commit is contained in:
b1ek 2023-03-04 17:08:54 +10:00
parent d4d7e6c8c2
commit 9d43ab9903
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,12 @@ async function upload(req, res) {
} }
const data = req.body.text; const data = req.body.text;
if (data.length < 8) {
res.send('Too short');
return;
}
const id = await content.create(data); const id = await content.create(data);
res.redirect( res.redirect(
'/view?id=' + encodeURIComponent(id) '/view?id=' + encodeURIComponent(id)