Update masqr middleware to use req.hostname instead of req.headers.host
This commit is contained in:
parent
216d93c429
commit
b3c04f1227
2 changed files with 2 additions and 2 deletions
2
index.js
2
index.js
|
|
@ -16,7 +16,7 @@ import cookies from "cookie-parser"
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
const whiteListedDomains = ["aluu.xyz"];
|
const whiteListedDomains = ["aluu.xyz", "localhost"];
|
||||||
const LICENSE_SERVER_URL = "https://license.mercurywork.shop/validate?license=";
|
const LICENSE_SERVER_URL = "https://license.mercurywork.shop/validate?license=";
|
||||||
const MASQR_ENABLED = process.env.MASQR_ENABLED;
|
const MASQR_ENABLED = process.env.MASQR_ENABLED;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ export async function masqrCheck(config, htmlFile) {
|
||||||
try {
|
try {
|
||||||
const loadedHTMLFile = fs.readFileSync(htmlFile, "utf8");
|
const loadedHTMLFile = fs.readFileSync(htmlFile, "utf8");
|
||||||
return async (req, res, next) => {
|
return async (req, res, next) => {
|
||||||
if (config.whitelist.includes(req.headers.host) || req.headers.host.includes("localhost")) {
|
if (config.whitelist.includes(req.hostname)) {
|
||||||
next();
|
next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue