From 5a569cbaf91578f553210e9d5ddf66cda50a37f5 Mon Sep 17 00:00:00 2001 From: Nathan DECHER Date: Mon, 13 Apr 2020 22:46:59 +0200 Subject: [PATCH] added username length limit --- api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.js b/api.js index 9fe55bd..9c3a8b2 100644 --- a/api.js +++ b/api.js @@ -58,7 +58,7 @@ api.post('/leaderboards/:category/:id', (req, res) => { err: 'Invalid mode' }); const username=req.body.username; - if((typeof username)!='string') return res.status(400).json({ + if((typeof username)!='string' || username.length>100) return res.status(400).json({ ok: false, err: 'Invalid username' });