diff --git a/server/server.js b/server/server.js index 2579b4ee..4e6361b3 100644 --- a/server/server.js +++ b/server/server.js @@ -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; }