also call res.end

pull/223/head
Fabian Jakobs 2015-11-23 13:29:05 +00:00
rodzic 6b1a1c9ee8
commit 5974323cfc
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -11,8 +11,10 @@ module.exports = function setup(mount, vfs, mountOptions) {
var errorHandler = mountOptions.errorHandler || function (req, res, err, code) { var errorHandler = mountOptions.errorHandler || function (req, res, err, code) {
console.error(err.stack || err); console.error(err.stack || err);
if (res.headersSent) if (res.headersSent) {
res.end("");
return; return;
}
if (code) res.statusCode = code; if (code) res.statusCode = code;
else if (typeof err.code == "number") res.statusCode = err.code; else if (typeof err.code == "number") res.statusCode = err.code;