traefik/vendor/github.com/xenolf/lego/challenge/dns01/cname.go
Ludovic Fernandez 2b2cfdfb32 Updates of Lego.
2019-02-13 17:26:04 +01:00

16 lines
285 B
Go

package dns01
import "github.com/miekg/dns"
// Update FQDN with CNAME if any
func updateDomainWithCName(r *dns.Msg, fqdn string) string {
for _, rr := range r.Answer {
if cn, ok := rr.(*dns.CNAME); ok {
if cn.Hdr.Name == fqdn {
return cn.Target
}
}
}
return fqdn
}