- Treat `[<any>.]localhost.` (ie localhost with FQDN period terminator)
as fixed value 127.0.0.1 and ::1 instead of querying the resolver.
Prior to this change,
b5c0fe20 (precedes 7.85.0) did the same for
non-FQDN `<any>.localhost`.
Prior to this change,
1a0ebf66 (precedes 7.78.0) did the same for
non-FQDN `localhost`.
Ref: https://github.com/curl/curl/issues/15628#issuecomment-
2515540315
Closes https://github.com/curl/curl/pull/15676
return CURLRESOLV_ERROR;
if(strcasecompare(hostname, "localhost") ||
- tailmatch(hostname, ".localhost"))
+ strcasecompare(hostname, "localhost.") ||
+ tailmatch(hostname, ".localhost") ||
+ tailmatch(hostname, ".localhost."))
addr = get_localhost(port, hostname);
#ifndef CURL_DISABLE_DOH
else if(allowDOH && data->set.doh && !ipnum)