fix: random domains
This commit is contained in:
parent
83718d7b31
commit
1b3d3a867b
1 changed files with 1 additions and 2 deletions
|
@ -175,8 +175,7 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
||||||
if (req.headers['override-domain']) {
|
if (req.headers['override-domain']) {
|
||||||
domain = `${zconfig.core.return_https ? 'https' : 'http'}://${req.headers['override-domain']}`;
|
domain = `${zconfig.core.return_https ? 'https' : 'http'}://${req.headers['override-domain']}`;
|
||||||
} else if (user.domains.length) {
|
} else if (user.domains.length) {
|
||||||
const randomDomain = user.domains[Math.floor(Math.random() * user.domains.length)];
|
domain = user.domains[Math.floor(Math.random() * user.domains.length)];
|
||||||
domain = `${zconfig.core.return_https ? 'https' : 'http'}://${randomDomain}`;
|
|
||||||
} else {
|
} else {
|
||||||
domain = `${zconfig.core.return_https ? 'https' : 'http'}://${req.headers.host}`;
|
domain = `${zconfig.core.return_https ? 'https' : 'http'}://${req.headers.host}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue