From b3c04f1227364e153c58a0579c925ea17df9058e Mon Sep 17 00:00:00 2001 From: wearrrrr Date: Fri, 20 Sep 2024 10:34:01 -0500 Subject: [PATCH] Update masqr middleware to use req.hostname instead of req.headers.host --- index.js | 2 +- middleware/Masqr/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e821d5a..b83a839 100644 --- a/index.js +++ b/index.js @@ -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; diff --git a/middleware/Masqr/index.js b/middleware/Masqr/index.js index 1fd0ce9..bba6fb6 100644 --- a/middleware/Masqr/index.js +++ b/middleware/Masqr/index.js @@ -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; }