namecheap: pass the TLD correctly
this is safe because namecheap does not allow external domains to be hosted. otherwise, we would have to use tldjs
This commit is contained in:
@@ -57,8 +57,8 @@ async function getZone(domainConfig, zoneName) {
|
||||
|
||||
const query = await getQuery(domainConfig);
|
||||
query.Command = 'namecheap.domains.dns.getHosts';
|
||||
query.SLD = zoneName.split('.')[0];
|
||||
query.TLD = zoneName.split('.')[1];
|
||||
query.SLD = zoneName.split('.', 1)[0];
|
||||
query.TLD = zoneName.slice(query.SLD.length + 1);
|
||||
|
||||
const [error, response] = await safe(superagent.get(ENDPOINT).query(query).ok(() => true));
|
||||
if (error) throw new BoxError(BoxError.NETWORK_ERROR, error.message);
|
||||
|
||||
Reference in New Issue
Block a user