Permalink
Browse files

change `timeout()` 408 to 503

seems more appropriate. Closes #719
  • Loading branch information...
1 parent 75b02bf commit 3f473e503da7550fa9e2d436817832e588865e47 @tj tj committed Jan 3, 2013
Showing with 5 additions and 5 deletions.
  1. +3 −3 lib/middleware/timeout.js
  2. +2 −2 test/timeout.js
@@ -37,9 +37,9 @@ module.exports = function timeout(ms) {
req.on('timeout', function(){
if (req.headerSent) return debug('response started, cannot timeout');
- var err = new Error('Request timeout');
+ var err = new Error('Response timeout');
err.timeout = ms;
- err.status = 408;
+ err.status = 503;
next(err);
});
@@ -53,4 +53,4 @@ module.exports = function timeout(ms) {
next();
};
-};
+};
View
@@ -29,7 +29,7 @@ describe('connect.timeout()', function(){
app.request()
.get('/')
- .expect(408, done);
+ .expect(503, done);
})
it('should pass the error to next()', function(done){
@@ -85,4 +85,4 @@ describe('connect.timeout()', function(){
.expect('Hello', done);
})
})
-})
+})

0 comments on commit 3f473e5

Please sign in to comment.