diff options
author | 2016-09-07 12:41:40 +0000 | |
---|---|---|
committer | 2016-09-07 12:55:41 +0000 | |
commit | 5216ab6b581165ae54b5d3462e3e63d460317cf3 (patch) | |
tree | 9800f823f7e330723c18e95c0d3046e8e7193595 /middleware/normalize.go | |
parent | d1f17fa7e061d91aa0af7e1fb959a68db899c812 (diff) | |
download | coredns-5216ab6b581165ae54b5d3462e3e63d460317cf3.tar.gz coredns-5216ab6b581165ae54b5d3462e3e63d460317cf3.tar.zst coredns-5216ab6b581165ae54b5d3462e3e63d460317cf3.zip |
Add tests for normalize.go
Fix some of the documentation in the process.
Diffstat (limited to 'middleware/normalize.go')
-rw-r--r-- | middleware/normalize.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/middleware/normalize.go b/middleware/normalize.go index e5b747620..e28ed96ea 100644 --- a/middleware/normalize.go +++ b/middleware/normalize.go @@ -16,7 +16,7 @@ func (z Zones) Matches(qname string) string { zone := "" for _, zname := range z { if dns.IsSubDomain(zname, qname) { - // TODO(miek): hmm, add test for this case + // We want the *longest* matching zone, otherwise we may end up in a parent if len(zname) > len(zone) { zone = zname } @@ -41,7 +41,6 @@ func (n Name) Matches(child string) bool { if dns.Name(n) == dns.Name(child) { return true } - return dns.IsSubDomain(string(n), child) } |