Wildcards #2

Merged
PapaTutuWawa merged 17 commits from feat/wildcards into master 2024-01-11 20:04:50 +00:00
Showing only changes of commit 2fb1e36b06 - Show all commits

View File

@ -61,10 +61,13 @@ func LookupCNAME(domain string) (string, error) {
return cname.(string), nil
}
cname, err := net.LookupCNAME(domain)
query, err := net.LookupCNAME(domain)
if err == nil {
cnameCache.Set(domain, cname, cache.DefaultExpiration)
return cname.(string), nil
if query[len(query)-1] == '.' {
query = query[:len(query)-1]
}
cnameCache.Set(domain, query, cache.DefaultExpiration)
return query, nil
}
return "", err