From 3d7e1d68cdf963321bb5a0b627e2d2b364810bf1 Mon Sep 17 00:00:00 2001 From: Bill Church Date: Mon, 17 May 2021 06:42:58 -0400 Subject: [PATCH] chore: fix some misplaced next returns in some Express routes #242 --- app/server/app.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/server/app.js b/app/server/app.js index 753bb1a4..0b0de386 100644 --- a/app/server/app.js +++ b/app/server/app.js @@ -164,10 +164,9 @@ app.use('/ssh', express.static(publicPath, expressOptions)); // favicon from root if being pre-fetched by browser to prevent a 404 app.use(favicon(path.join(publicPath, 'favicon.ico'))); -app.get('/ssh/reauth', (req, res, next) => { +app.get('/ssh/reauth', (req, res) => { const r = req.headers.referer || '/'; res.status(401).send(``); - next(); }); // eslint-disable-next-line complexity @@ -214,15 +213,13 @@ app.get('/ssh/host/:host?', (req, res) => { }); // express error handling -app.use((req, res, next) => { +app.use((req, res) => { res.status(404).send("Sorry, can't find that!"); - next(); }); -app.use((err, req, res, next) => { +app.use((err, req, res) => { console.error(err.stack); res.status(500).send('Something broke!'); - next(); }); // bring up socket