pki/vendor/github.com/go-acme/lego/v4/challenge/dns01/cname.go
Paul Lecuq a7d4f06285
All checks were successful
continuous-integration/drone/push Build is passing
ready for public beta
2020-11-25 20:36:07 +01:00

17 lines
286 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
}