forked from svrjs/svrjs
Add proxySafe flag to middleware.
This commit is contained in:
parent
fb7c5ed854
commit
4b02efdeba
13 changed files with 27 additions and 0 deletions
|
@ -710,6 +710,9 @@ function requestHandler(req, res) {
|
||||||
// Call the next middleware function
|
// Call the next middleware function
|
||||||
const next = () => {
|
const next = () => {
|
||||||
const currentMiddleware = middleware[index++];
|
const currentMiddleware = middleware[index++];
|
||||||
|
while (req.isProxy && currentMiddleware && !currentMiddleware.proxySafe) {
|
||||||
|
currentMiddleware = middleware[index++];
|
||||||
|
}
|
||||||
if (currentMiddleware) {
|
if (currentMiddleware) {
|
||||||
try {
|
try {
|
||||||
currentMiddleware(req, res, logFacilities, config, next);
|
currentMiddleware(req, res, logFacilities, config, next);
|
||||||
|
|
|
@ -51,3 +51,5 @@ module.exports.commands = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
||||||
|
|
|
@ -111,3 +111,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
|
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -37,3 +37,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
|
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -462,3 +462,5 @@ module.exports.commands = {
|
||||||
passCommand(args, log);
|
passCommand(args, log);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -32,3 +32,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -79,3 +79,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
|
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -12,3 +12,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
|
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -153,3 +153,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -990,3 +990,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -134,3 +134,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -52,3 +52,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
|
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
|
@ -140,3 +140,5 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
|
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.proxySafe = true;
|
Reference in a new issue