godaddy: add missing customNameservers check

This commit is contained in:
Girish Ramakrishnan
2025-10-10 16:30:53 +02:00
parent f7e073c857
commit a7d8a8fd1f

View File

@@ -163,12 +163,14 @@ async function verifyDomainConfig(domainObject) {
if (!domainConfig.apiKey || typeof domainConfig.apiKey !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'apiKey must be a non-empty string');
if (!domainConfig.apiSecret || typeof domainConfig.apiSecret !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'apiSecret must be a non-empty string');
if ('customNameservers' in domainConfig && typeof domainConfig.customNameservers !== 'boolean') throw new BoxError(BoxError.BAD_FIELD, 'customNameservers must be a boolean');
const ip = '127.0.0.1';
const credentials = {
apiKey: domainConfig.apiKey,
apiSecret: domainConfig.apiSecret
apiSecret: domainConfig.apiSecret,
customNameservers: !!domainConfig.customNameservers
};
if (constants.TEST) return credentials; // this shouldn't be here
@@ -179,7 +181,7 @@ async function verifyDomainConfig(domainObject) {
if (!nameservers.every(function (n) { return n.toLowerCase().indexOf('.domaincontrol.com') !== -1 || n.toLowerCase().indexOf('.secureserver.net') !== -1; })) {
debug('verifyDomainConfig: %j does not contain GoDaddy NS', nameservers);
throw new BoxError(BoxError.BAD_FIELD, 'Domain nameservers are not set to GoDaddy');
if (!domainConfig.customNameservers) throw new BoxError(BoxError.BAD_FIELD, 'Domain nameservers are not set to GoDaddy');
}
const location = 'cloudrontestdns';