added username length limit

This commit is contained in:
Nathan DECHER 2020-04-13 22:46:59 +02:00
parent b0106f9df0
commit 5a569cbaf9
1 changed files with 1 additions and 1 deletions

2
api.js
View File

@ -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'
});