diff --git a/integration_flags_test.go b/integration_flags_test.go index be75414..90fb14d 100644 --- a/integration_flags_test.go +++ b/integration_flags_test.go @@ -173,7 +173,7 @@ var _ = Describe("flags", func() { flags = []string{"-delegates="} }) It("should give an informative message", func() { - Expect(string(serverSession.Err.Contents())).Should(MatchRegexp(`-delegates: arguments should be in the format "delegatedDomain=nameserver", not ""`)) + Expect(string(serverSession.Err.Contents())).Should(Not(MatchRegexp(`-delegates`))) }) }) When("the arguments are mangled", func() { diff --git a/xip/xip.go b/xip/xip.go index 0087152..1677ec9 100644 --- a/xip/xip.go +++ b/xip/xip.go @@ -250,6 +250,9 @@ func NewXip(blocklistURL string, nameservers []string, addresses []string, deleg } // Parse and set the nameservers of our delegated domains for _, delegate := range delegates { + if delegate == "" { // most common case: no delegates defined + continue + } delegatedDomainAndNameserver := strings.Split(strings.ToLower(delegate), "=") if len(delegatedDomainAndNameserver) != 2 { logmessages = append(logmessages, fmt.Sprintf(`-delegates: arguments should be in the format "delegatedDomain=nameserver", not "%s"`, delegate))