Adding check to only allow a list of categories

This commit is contained in:
Nanobyte
2020-09-09 16:40:13 +02:00
parent 6fe8dfc188
commit dec0971c14
3 changed files with 12 additions and 1 deletions

View File

@@ -150,6 +150,11 @@ function categoryVote(UUID, userID, isVIP, category, hashedIP, res) {
res.status("400").send("Submission doesn't exist.");
return;
}
if (!config.categoryList.includes(category)) {
res.status("400").send("Category doesn't exist.");
return;
}
let timeSubmitted = Date.now();