Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow error listeners to handle response

  • Loading branch information...
commit fb495dcbcb35cba076528c78ecce720e9ea8096d 1 parent 276c12f
@guybedford guybedford authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/node-static.js
View
6 lib/node-static.js
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.