mirror of
https://github.com/coredns/coredns.git
synced 2025-11-11 14:32:25 -05:00
middleware/file: fix delegations (#376)
Fix the delegation handling in the *file* and *dnssec* middleware. Refactor tests a bit and show that they are failling. Add a Tree printer, cleanups and tests. Fix wildcard test - should get no answer from empty-non-terminal
This commit is contained in:
@@ -52,13 +52,10 @@ func (e *Elem) Name() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// IsWildcard returns true if this name starts with a wildcard label (*.)
|
||||
func (e *Elem) IsWildcard() bool {
|
||||
n := e.Name()
|
||||
if len(n) < 2 {
|
||||
return false
|
||||
}
|
||||
return n[0] == '*' && n[1] == '.'
|
||||
// Empty returns true is e does not contain any RRs, i.e. is an
|
||||
// empty-non-terminal.
|
||||
func (e *Elem) Empty() bool {
|
||||
return len(e.m) == 0
|
||||
}
|
||||
|
||||
// Insert inserts rr into e. If rr is equal to existing rrs this is a noop.
|
||||
|
||||
Reference in New Issue
Block a user