From 03b047bd59ccf88e0e94399c8ddcbb0afadc2ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 2 May 2016 18:28:33 +0300 Subject: [PATCH] fix another crash --- src/routes/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/index.js b/src/routes/index.js index 1b08d42020..8efdc1f2a7 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -174,7 +174,7 @@ function handle404(app, middleware) { res.type('text/javascript').status(200).send(''); } else if (isLanguage.test(req.url)) { res.status(200).json({}); - } else if (req.path.startsWith(relativePath + '/uploads') || req.get('accept').indexOf('text/html') === -1 || req.path === '/favicon.ico') { + } else if (req.path.startsWith(relativePath + '/uploads') || (req.get('accept') && req.get('accept').indexOf('text/html') === -1) || req.path === '/favicon.ico') { res.sendStatus(404); } else if (req.accepts('html')) { if (process.env.NODE_ENV === 'development') {