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
5575bcf60c
commit
07c8d2ee60
@ -125,11 +125,15 @@ 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;
|
console.error(err.stack);
|
||||||
//
|
if (res._headerSent) {
|
||||||
// TODO: figure out where to send errors.
|
res.destroy();
|
||||||
// return error(req, res, err);
|
} else {
|
||||||
//
|
res.statusCode = 500;
|
||||||
|
res.setHeader('Content-Type', 'text/plain');
|
||||||
|
res.end('Internal Server Error');
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
child(req, res);
|
child(req, res);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user