diff --git a/src/handlers.ts b/src/handlers.ts index 344c7eaa..4abd2351 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -54,6 +54,7 @@ function defaultErrorHandler(err, req, res) { case 'ECONNRESET': case 'ENOTFOUND': case 'ECONNREFUSED': + case 'ETIMEDOUT': res.writeHead(504); break; default: diff --git a/test/unit/handlers.spec.ts b/test/unit/handlers.spec.ts index 385cc72c..b64a850a 100644 --- a/test/unit/handlers.spec.ts +++ b/test/unit/handlers.spec.ts @@ -104,6 +104,7 @@ describe('default proxy error handler', () => { ['ECONNREFUSED', 504], ['ENOTFOUND', 504], ['ECONNREFUSED', 504], + ['ETIMEDOUT', 504], ['any', 500], ];