consolidate hyphenatedSubdomains handling

This commit is contained in:
Girish Ramakrishnan
2018-09-11 21:24:04 -07:00
parent d0eba4d3e3
commit 7a07e0220f
10 changed files with 28 additions and 51 deletions
+1 -3
View File
@@ -210,12 +210,10 @@ function verifyDnsConfig(dnsConfig, fqdn, zoneName, ip, callback) {
if (typeof dnsConfig.username !== 'string') return callback(new DomainsError(DomainsError.BAD_FIELD, 'username must be a string'));
if (typeof dnsConfig.token !== 'string') return callback(new DomainsError(DomainsError.BAD_FIELD, 'token must be a string'));
if ('hyphenatedSubdomains' in dnsConfig && typeof dnsConfig.hyphenatedSubdomains !== 'boolean') return callback(new DomainsError(DomainsError.BAD_FIELD, 'hyphenatedSubdomains must be a boolean'));
var credentials = {
username: dnsConfig.username,
token: dnsConfig.token,
hyphenatedSubdomains: !!dnsConfig.hyphenatedSubdomains
token: dnsConfig.token
};
if (process.env.BOX_ENV === 'test') return callback(null, credentials); // this shouldn't be here