[Pkg-javascript-commits] [node-static] 93/151: Allow error listeners to handle response
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Tue Jan 7 23:18:00 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository node-static.
commit fb495dcbcb35cba076528c78ecce720e9ea8096d
Author: Guy Bedford <guybedford at gmail.com>
Date: Thu Dec 6 17:30:52 2012 +0200
Allow error listeners to handle response
---
lib/node-static.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/node-static.js b/lib/node-static.js
index f0c0766..d6775e7 100644
--- a/lib/node-static.js
+++ b/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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-static.git
More information about the Pkg-javascript-commits
mailing list