Commit 07c8d2ee authored by Tj Holowaychuk's avatar Tj Holowaychuk Committed by indexzero

Fixed large DoS vector in the middleware implementation

parent 5575bcf6
......@@ -125,11 +125,15 @@ exports.stack = function stack (middlewares, proxy) {
handle = function (req, res) {
var next = function (err) {
if (err) {
throw err;
//
// TODO: figure out where to send errors.
// return error(req, res, err);
//
console.error(err.stack);
if (res._headerSent) {
res.destroy();
} else {
res.statusCode = 500;
res.setHeader('Content-Type', 'text/plain');
res.end('Internal Server Error');
}
return;
}
child(req, res);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment