1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

throw an error if a domain name is declared more than once (#247)

* throw an error if a domain name is declared more than once in the js file
This commit is contained in:
Pat Moroney
2017-11-14 21:14:45 -07:00
committed by Tom Limoncelli
parent 2ef1fc42f8
commit 106790b0d5
5 changed files with 74 additions and 109 deletions

View File

@@ -4,6 +4,7 @@ var conf = {
registrars: [],
dns_providers: [],
domains: [],
domain_names: [],
};
var defaultArgs = [];
@@ -78,7 +79,11 @@ function D(name, registrar) {
var m = arguments[i];
processDargs(m, domain);
}
if(conf.domain_names.indexOf(name) !== -1) {
throw name + " is declared more than once"
}
conf.domains.push(domain);
conf.domain_names.push(name);
}
// DEFAULTS provides a set of default arguments to apply to all future domains.