Prevented sponsor segments less than 1 seconds from being submitted.

This commit is contained in:
Ajay Ramachandran
2019-07-23 19:06:43 -04:00
parent db8c2e76e5
commit ab0631ff63

View File

@@ -84,7 +84,9 @@ app.get('/api/postVideoSponsorTimes', function (req, res) {
let endTime = req.query.endTime;
let userID = req.query.userID;
if (videoID == undefined || startTime == undefined || endTime == undefined || userID == undefined) {
//check if all correct inputs are here and the length is 1 second or more
if (videoID == undefined || startTime == undefined || endTime == undefined || userID == undefined
|| Math.abs(startTime - endTime) < 1) {
//invalid request
res.sendStatus(400);
return;