Wildcards #2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user