pki/vendor/github.com/go-acme/lego/v4/challenge/dns01/cname.go
Paul Lecuq bfb5ee44ce
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
updated dependencies
2023-10-01 12:07:22 +02:00

21 lines
320 B
Go

package dns01
import (
"strings"
"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 strings.EqualFold(cn.Hdr.Name, fqdn) {
return cn.Target
}
}
}
return fqdn
}