Update masqr middleware to use req.hostname instead of req.headers.host

This commit is contained in:
wearrrrr 2024-09-20 10:34:01 -05:00
parent 216d93c429
commit b3c04f1227
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ import cookies from "cookie-parser"
dotenv.config();
const whiteListedDomains = ["aluu.xyz"];
const whiteListedDomains = ["aluu.xyz", "localhost"];
const LICENSE_SERVER_URL = "https://license.mercurywork.shop/validate?license=";
const MASQR_ENABLED = process.env.MASQR_ENABLED;

View file

@ -4,7 +4,7 @@ export async function masqrCheck(config, htmlFile) {
try {
const loadedHTMLFile = fs.readFileSync(htmlFile, "utf8");
return async (req, res, next) => {
if (config.whitelist.includes(req.headers.host) || req.headers.host.includes("localhost")) {
if (config.whitelist.includes(req.hostname)) {
next();
return;
}