mirror of
https://github.com/coredns/coredns.git
synced 2025-12-09 03:45:11 -05:00
core: small cleanup (#877)
Add some docs about normalize.Host and normalize.Name. They are used correctly in the middleware even though they are somewhat confusing, esp when you copy from ServerBlockKeys in your middleware.
This commit is contained in:
@@ -30,7 +30,8 @@ func (z Zones) Matches(qname string) string {
|
||||
return zone
|
||||
}
|
||||
|
||||
// Normalize fully qualifies all zones in z.
|
||||
// Normalize fully qualifies all zones in z. The zones in Z must be domain names, without
|
||||
// a port or protocol prefix.
|
||||
func (z Zones) Normalize() {
|
||||
for i := range z {
|
||||
z[i] = Name(z[i]).Normalize()
|
||||
@@ -54,7 +55,7 @@ func (n Name) Normalize() string { return strings.ToLower(dns.Fqdn(string(n))) }
|
||||
|
||||
type (
|
||||
// Host represents a host from the Corefile, may contain port.
|
||||
Host string // Host represents a host from the Corefile, may contain port.
|
||||
Host string
|
||||
)
|
||||
|
||||
// Normalize will return the host portion of host, stripping
|
||||
|
||||
Reference in New Issue
Block a user