fix: Hostname issue
This commit is contained in:
@@ -202,7 +202,6 @@ export async function checkDomainsIsValidInDNS({ hostname, fqdn, dualCerts }): P
|
|||||||
const domainDualCert = domain.includes('www.') ? domain.replace('www.', '') : `www.${domain}`;
|
const domainDualCert = domain.includes('www.') ? domain.replace('www.', '') : `www.${domain}`;
|
||||||
dns.setServers(['1.1.1.1', '8.8.8.8']);
|
dns.setServers(['1.1.1.1', '8.8.8.8']);
|
||||||
let resolves = [];
|
let resolves = [];
|
||||||
console.log(hostname)
|
|
||||||
try {
|
try {
|
||||||
if (isIP(hostname)) {
|
if (isIP(hostname)) {
|
||||||
resolves = [hostname];
|
resolves = [hostname];
|
||||||
|
@@ -324,7 +324,7 @@ export async function checkDNS(request: FastifyRequest<CheckDNS>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isDNSCheckEnabled && !isDev && !forceSave) {
|
if (isDNSCheckEnabled && !isDev && !forceSave) {
|
||||||
return await checkDomainsIsValidInDNS({ hostname: request.hostname, fqdn, dualCerts });
|
return await checkDomainsIsValidInDNS({ hostname: request.hostname.split(':')[0], fqdn, dualCerts });
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
} catch ({ status, message }) {
|
} catch ({ status, message }) {
|
||||||
|
@@ -67,7 +67,7 @@ export async function checkDomain(request: FastifyRequest, reply: FastifyReply)
|
|||||||
throw "Domain already configured";
|
throw "Domain already configured";
|
||||||
}
|
}
|
||||||
if (isDNSCheckEnabled && !forceSave) {
|
if (isDNSCheckEnabled && !forceSave) {
|
||||||
return await checkDomainsIsValidInDNS({ hostname: request.hostname, fqdn, dualCerts });
|
return await checkDomainsIsValidInDNS({ hostname: request.hostname.split(':')[0], fqdn, dualCerts });
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
} catch ({ status, message }) {
|
} catch ({ status, message }) {
|
||||||
|
Reference in New Issue
Block a user