Permalink
Browse files

Allow error listeners to handle response

  • Loading branch information...
guybedford committed Dec 6, 2012
1 parent 276c12f commit fb495dcbcb35cba076528c78ecce720e9ea8096d
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/node-static.js
View
@@ -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;

0 comments on commit fb495dc

Please sign in to comment.