mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 08:54:17 -04:00
Handle incorrect post requests correctly
This commit is contained in:
@@ -83,6 +83,11 @@ app.get('/', (req, res) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
app.post('/', async (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");
|
const check = req.body.password === (process.env.SECURITY_CODE || "0000");
|
||||||
|
|
||||||
if(!check) {
|
if(!check) {
|
||||||
|
|||||||
Reference in New Issue
Block a user