Dns.join (#944)
* Add dnsutil.Join * Create dnsutil.Join Create Join helper function and move bits in the code over.
This commit is contained in:
parent
7c343982a6
commit
02955d7594
8 changed files with 52 additions and 14 deletions
|
@ -4,6 +4,8 @@ import (
|
|||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/coredns/coredns/middleware/pkg/dnsutil"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
|
@ -24,7 +26,7 @@ func Domain(s string) string {
|
|||
for i, j := 1, len(l)-1; i < j; i, j = i+1, j-1 {
|
||||
l[i], l[j] = l[j], l[i]
|
||||
}
|
||||
return dns.Fqdn(strings.Join(l[1:len(l)-1], "."))
|
||||
return dnsutil.Join(l[1 : len(l)-1])
|
||||
}
|
||||
|
||||
// PathWithWildcard ascts as Path, but if a name contains wildcards (* or any), the name will be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue