![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ts.corals.io/frontend/node_modules/requrl/dist/ |
function isHTTPS(req, trustProxy = true) { const _xForwardedProto = trustProxy && req.headers ? req.headers["x-forwarded-proto"] : void 0; const protoCheck = typeof _xForwardedProto === "string" ? _xForwardedProto.includes("https") : void 0; if (protoCheck) { return true; } const _encrypted = req.connection ? req.connection.encrypted : void 0; const encryptedCheck = _encrypted !== void 0 ? _encrypted === true : void 0; if (encryptedCheck) { return true; } if (protoCheck === void 0 && encryptedCheck === void 0) { return void 0; } return false; } var dist = isHTTPS; const _location = typeof location !== "undefined" ? location : {origin: "", pathname: "/"}; function getURL(req, includePath) { if (!req) { return _location.origin + (includePath ? _location.pathname : ""); } return encodeURI("http" + (dist(req) ? "s" : "") + "://" + (req.headers["x-forwarded-host"] || req.headers.host) + (includePath ? req.url : "")); } export default getURL;