Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Typo fix in timeout middleware [req->res] #754

Merged
merged 1 commit into from

2 participants

@nfarina

Discovered this apparent typo while testing the timeout middleware. As far as I can tell "headerSent" is never defined on the ServerRequest object, instead it's on ServerResponse.

@tj tj merged commit 8a87714 into senchalabs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2013
  1. @nfarina
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 2 deletions.
  1. +1 −2  lib/middleware/timeout.js
View
3  lib/middleware/timeout.js
@@ -1,4 +1,3 @@
-
/*!
* Connect - timeout
* Ported from https://github.com/LearnBoost/connect-timeout
@@ -36,7 +35,7 @@ module.exports = function timeout(ms) {
}, ms);
req.on('timeout', function(){
- if (req.headerSent) return debug('response started, cannot timeout');
+ if (res.headerSent) return debug('response started, cannot timeout');
var err = new Error('Response timeout');
err.timeout = ms;
err.status = 503;
Something went wrong with that request. Please try again.