1
0
Fork 0
forked from svrjs/svrjs

Dropped support for HTTP to HTTPS redirect bypass headers

This commit is contained in:
Dorian Niemiec 2023-09-02 19:12:46 +02:00
parent 1637e87550
commit fdac578678

4
svr.js
View file

@ -2108,9 +2108,6 @@ if (!cluster.isPrimary) {
if (server2.requestTimeout !== undefined && server2.requestTimeout === 0) server2.requestTimeout = 300000; if (server2.requestTimeout !== undefined && server2.requestTimeout === 0) server2.requestTimeout = 300000;
function redirhandler(req, res) { function redirhandler(req, res) {
if (req.headers["force-insecure"] == "true" || req.headers["x-force-insecure"] == "true" || req.headers["x-svr-js-force-insecure"] == "true") {
reqhandler(req, res, false);
} else {
var reqIdInt = Math.round(Math.random() * 16777216); var reqIdInt = Math.round(Math.random() * 16777216);
var reqId = "0".repeat(6 - reqIdInt.toString(16).length) + reqIdInt.toString(16); var reqId = "0".repeat(6 - reqIdInt.toString(16).length) + reqIdInt.toString(16);
var serverconsole = { var serverconsole = {
@ -2576,7 +2573,6 @@ if (!cluster.isPrimary) {
callServerError(500, undefined, generateErrorStack(err)); callServerError(500, undefined, generateErrorStack(err));
} }
} }
}
function reqerrhandler(err, socket, fromMain) { function reqerrhandler(err, socket, fromMain) {
if (fromMain === undefined) fromMain = true; if (fromMain === undefined) fromMain = true;