diff --git a/middleware/408.js b/middleware/408.js index 92dc9723..109fa5eb 100644 --- a/middleware/408.js +++ b/middleware/408.js @@ -6,7 +6,7 @@ function middleware(err, req, res, next) { if( res.statusCode === 408 || (error.toLowerCase().indexOf('request timeout') !== -1) ){ res.status(408); - res.json({ error: error === 'string' ? error : 'request time out' }); + res.json({ error: typeof error === 'string' ? error : 'request time out' }); } else { next(err); }