Skip to content

Commit

Permalink
fixed sending error twice when another middleware already sent the he…
Browse files Browse the repository at this point in the history
…aders
  • Loading branch information
arnoux committed Oct 16, 2013
1 parent f788253 commit a18665e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/output-handler.server.js
Expand Up @@ -123,7 +123,7 @@ OutputHandler.prototype = {


_writeHeaders: function() {
if (!this.headersSent) {
if (!this.res.headersSent) {

// passing a falsy reason phrase would break, because node uses every non-string arguments[1]
// as header object/array
Expand All @@ -132,8 +132,6 @@ OutputHandler.prototype = {
} else {
this.res.writeHead(this.statusCode || 200, this.headers);
}

this.headersSent = true;
}
}
};
Expand Down

0 comments on commit a18665e

Please sign in to comment.