Move in progress apps temporarily

This commit is contained in:
Darren Clarke 2023-03-07 14:09:49 +00:00
parent ba04aa108c
commit 6eaaf8e9be
360 changed files with 6171 additions and 55 deletions

View file

@ -1,35 +0,0 @@
import { IncomingMessage } from "http";
function absoluteUrl(
req?: IncomingMessage,
localhostAddress = "localhost:3000"
) {
let host =
(req?.headers ? req.headers.host : window.location.host) ||
localhostAddress;
let protocol = /^localhost(:\d+)?$/.test(host) ? "http:" : "https:";
if (
req &&
req.headers["x-forwarded-host"] &&
typeof req.headers["x-forwarded-host"] === "string"
) {
host = req.headers["x-forwarded-host"];
}
if (
req &&
req.headers["x-forwarded-proto"] &&
typeof req.headers["x-forwarded-proto"] === "string"
) {
protocol = `${req.headers["x-forwarded-proto"]}:`;
}
return {
protocol,
host,
origin: protocol + "//" + host,
};
}
export default absoluteUrl;