diff options
Diffstat (limited to 'middleware/zone.go')
-rw-r--r-- | middleware/zone.go | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/middleware/zone.go b/middleware/zone.go deleted file mode 100644 index 0f3cd0edc..000000000 --- a/middleware/zone.go +++ /dev/null @@ -1,27 +0,0 @@ -package middleware - -import "github.com/miekg/dns" - -type Zones []string - -// Matches checks is qname is a subdomain of any of the zones in z. The match -// will return the most specific zones that matches other. The empty string -// signals a not found condition. -func (z Zones) Matches(qname string) string { - zone := "" - for _, zname := range z { - if dns.IsSubDomain(zname, qname) { - if len(zname) > len(zone) { - zone = zname - } - } - } - return zone -} - -// FullyQualify fully qualifies all zones in z. -func (z Zones) FullyQualify() { - for i, _ := range z { - z[i] = dns.Fqdn(z[i]) - } -} |