Commit 0e369129 authored by indexzero's avatar indexzero

Fixed large DoS vector in the middleware implementation

parent 0c71119e
...@@ -222,12 +222,19 @@ exports.stack = function stack (middlewares, proxy) { ...@@ -222,12 +222,19 @@ exports.stack = function stack (middlewares, proxy) {
handle = function (req, res) { handle = function (req, res) {
var next = function (err) { var next = function (err) {
if (err) { if (err) {
throw err; if (res._headerSent) {
// res.destroy();
// TODO: figure out where to send errors. }
// return error(req, res, err); else {
// res.statusCode = 500;
res.setHeader('Content-Type', 'text/plain');
res.end('Internal Server Error');
}
console.error('Error in middleware(s): %s', err.stack);
return;
} }
child(req, res); 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