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
tj committed Sep 1, 2011
1 parent 7beead5 commit 8cf6d7c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/node-http-proxy.js
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8cf6d7c

Please sign in to comment.