diff --git a/app.js b/app.js index 6e4fc79..835a54e 100644 --- a/app.js +++ b/app.js @@ -66,7 +66,7 @@ app.get('/camevent', (req, res) => { app.get('/viewcamimg/:dir/:img', async(req, res) => { let dir = req.params.dir; let img = req.params.img; - if (!dir || !img) return res.status(404).end(); + if (!dir || !img) return res.sendStatus(404); try { let stat = await new Promise((resolve, reject) => { fs.stat(path.resolve(config.cmdpath.ipcamsave, dir, img), (err, stats) => { @@ -74,9 +74,9 @@ app.get('/viewcamimg/:dir/:img', async(req, res) => { return resolve(stats); }) }) - if (!stat.isFile()) return res.status(404).end(); + if (!stat.isFile()) return res.sendStatus(404); } catch (e) { - return res.status(404).end(); + return res.sendStatus(404); } res.sendfile(path.resolve(config.cmdpath.ipcamsave, dir, img)) })