fix another crash

This commit is contained in:
Barış Soner Uşaklı
2016-05-02 18:28:33 +03:00
parent 27ad34138b
commit 03b047bd59

View File

@@ -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') {