mirror of
https://github.com/coredns/coredns.git
synced 2025-11-15 00:12:16 -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:
13
middleware/file/wildcard.go
Normal file
13
middleware/file/wildcard.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package file
|
||||
|
||||
import "github.com/miekg/dns"
|
||||
|
||||
// replaceWithWildcard replaces the left most label with '*'.
|
||||
func replaceWithAsteriskLabel(qname string) (wildcard string) {
|
||||
i, shot := dns.NextLabel(qname, 0)
|
||||
if shot {
|
||||
return ""
|
||||
}
|
||||
|
||||
return "*." + qname[i:]
|
||||
}
|
||||
Reference in New Issue
Block a user