make validation case-insensitive

This commit is contained in:
cynic 2024-06-03 01:07:45 +00:00
parent 5b4fd41ffa
commit 17a8ed4414

View File

@ -105,11 +105,11 @@ func (s *MeshnameServer) handleMeshnameRequest(w dns.ResponseWriter, r *dns.Msg)
}
// process domain
input := strings.TrimSuffix(q.Name, ".")
input := strings.ToLower(strings.TrimSuffix(q.Name, "."))
subDomain := ""
tld := ""
for i := range tldList {
t := tldList[i]
t := strings.ToLower(tldList[i])
if strings.HasSuffix(input, "."+t) {
// define tld
tld = t