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:
Miek Gieben
2016-11-05 14:39:49 +00:00
committed by GitHub
parent d6902cd7a1
commit 2cca527d9f
18 changed files with 658 additions and 624 deletions

View File

@@ -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.