Reverting unwanted notfound page response

This commit is contained in:
Varghese Thomas 2017-08-12 00:29:25 +05:30
parent a9c1dd0180
commit 70813556ad

View File

@ -133,7 +133,7 @@ app.get('/jsconfig.js', (req, res) => {
app.get('/exists/:id', async (req, res) => {
const id = req.params.id;
if (!validateID(id)) {
res.status(404).render('notfound');
res.sendStatus(404);
return;
}
@ -141,7 +141,7 @@ app.get('/exists/:id', async (req, res) => {
await storage.exists(id);
res.sendStatus(200);
} catch (e) {
res.status(404).render('notfound');
res.sendStatus(404);
}
});
@ -172,7 +172,7 @@ app.get('/download/:id', async (req, res) => {
app.get('/assets/download/:id', async (req, res) => {
const id = req.params.id;
if (!validateID(id)) {
res.status(404).render('notfound');
res.sendStatus(404);
return;
}
@ -197,7 +197,7 @@ app.get('/assets/download/:id', async (req, res) => {
file_stream.pipe(res);
} catch (e) {
res.status(404).render('notfound');
res.sendStatus(404);
}
});
@ -205,14 +205,14 @@ app.post('/delete/:id', async (req, res) => {
const id = req.params.id;
if (!validateID(id)) {
res.status(404).render('notfound');
res.sendStatus(404);
return;
}
const delete_token = req.body.delete_token;
if (!delete_token) {
res.status(404).render('notfound');
res.sendStatus(404);
return;
}
@ -222,7 +222,7 @@ app.post('/delete/:id', async (req, res) => {
res.sendStatus(200);
}
} catch (e) {
res.status(404).render('notfound');
res.sendStatus(404);
}
});
@ -242,7 +242,7 @@ app.post('/upload', (req, res, next) => {
!meta.hasOwnProperty('filename') ||
!validateIV(meta.id)
) {
res.status(404).render('notfound');
res.sendStatus(404);
return;
}