added username length limit

main
Codinget 5 years ago
parent c2b08cfc9c
commit 99599a3756
  1. 2
      api.js

@ -58,7 +58,7 @@ api.post('/leaderboards/:category/:id', (req, res) => {
err: 'Invalid mode' err: 'Invalid mode'
}); });
const username=req.body.username; 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, ok: false,
err: 'Invalid username' err: 'Invalid username'
}); });

Loading…
Cancel
Save