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:
committed by
Tom Limoncelli
parent
2ef1fc42f8
commit
106790b0d5
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user