mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Fixed large DoS vector in the middleware implementation
This commit is contained in:
parent
0c71119ee5
commit
0e36912906
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user