Handle incorrect post requests correctly

This commit is contained in:
Glenn de Haan
2022-11-14 16:43:11 +01:00
parent 65c29e2e83
commit 1dbbcd9e44

View File

@@ -83,6 +83,11 @@ app.get('/', (req, res) => {
});
});
app.post('/', async (req, res) => {
if(typeof req.body === "undefined") {
res.status(400).send();
return;
}
const check = req.body.password === (process.env.SECURITY_CODE || "0000");
if(!check) {