Skip to content

Commit

Permalink
Allow error listeners to handle response
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Dec 6, 2012
1 parent 276c12f commit fb495dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/node-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ exports.Server.prototype.finish = function (status, headers, req, res, promise,
if (promise.listeners('error').length > 0) {
promise.emit('error', result);
}
res.writeHead(status, headers);
res.end();
else {
res.writeHead(status, headers);
res.end();
}
}
} else {
// Don't end the request here, if we're streaming;
Expand Down

0 comments on commit fb495dc

Please sign in to comment.