-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curl does not automatically resolve *.localhost
like Chrome does.
#9192
Comments
I would argue that libcurl is not a name resolution API or library, but it uses such APIs and clearly they don't adhere to that RFC. We could of course still special-case those names like we do with |
Since the name resolution API |
I suppose the fact that Firefox and Chrome do this could be reason enough. |
Following the footsteps of other clients like Firefox/Chrome. RFC 6761 says clients SHOULD do this. Add test 389 to verify. Reported-by: TheKnarf on github Fixes #9192
On Thu, Jul 21, 2022 at 10:15:16AM -0700, TheKnarf wrote:
Name resolution APIs and libraries SHOULD recognize localhost names as
special and SHOULD always return the IP loopback address for address
queries and negative responses for all other query types. Name resolution
APIs SHOULD NOT send queries for localhost names to their configured
caching DNS server(s).
curl is not a name resolution API. Why do you think this is a curl issue and
not an issue with the name resolution API curl is using?
|
@bagder Since this is closed and locked.
Most operating system does this by default now but they respect the Isn't better to mimic that behaviour instead?
I agree with this. |
I did this
In my local development env I got Hasura running and responding on
hasura.localhost
. This works fine in Chrome, I can open the web UI and do stuff from there. However when querying it get the following errorThis seems to break RFC-6761:
So it seems that Chrome resolves
hasura.localhost
as the localhost loopback, while curl does not.Now there is a simple fix for my use case, I can simply add
--resolve hasura.localhost:80:127.0.0.1
to my curl command and it works fine. However this should not be necessary according to RFC-6761.I expected the following
To get an result from the endpoint without having to add
--resolve
.curl/libcurl version
operating system
The text was updated successfully, but these errors were encountered: