mirror of
https://github.com/curl/curl.git
synced 2025-09-10 22:22:43 +03:00
hostip: don't use the resolver for FQDN localhost
- 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
This commit is contained in:
parent
6755ba593c
commit
a4458c7ee3
|
@ -798,7 +798,9 @@ enum resolve_t Curl_resolv(struct Curl_easy *data,
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user