Skip to content

Commit

Permalink
Fixed large DoS vector in the middleware implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Sep 8, 2011
1 parent 0c71119 commit 0e36912
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/node-http-proxy.js
Expand Up @@ -222,12 +222,19 @@ 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);
//
if (res._headerSent) {
res.destroy();
}
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);
}

Expand Down

0 comments on commit 0e36912

Please sign in to comment.