-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Return a 404 instead of a 500 http code when dnslink not found for domain #6746
Comments
@lidel what say you? |
This is part of a bigger problem: In this specific case it should be fairly safe to change response code: dnslink lookup result status code is usually compared against Personal nit: I don't like |
Agree with @lidel regarding the |
The HTTP API is an RPC API over HTTP, not a REST API. Trying to make it conform to REST semantics was much more trouble than it was worth. HTTP Codes are used at the RPC layer:
In this case, "404" would mean that the |
@lidel this really should be documented somewhere. Could you try to find a place to put it? |
Can we discuss improving this? |
If someone implements a fix that actually works reliably, I'd be happy to accept it. However, I'm pretty sure there is no nice solution. IIRC, there were two key issues:
For example, a user might call
Basically, the only error conditions we can reliably report in the status code are ones related to the RPC layer (endpoint not found, request malformed, etc.). |
For some context, I've sunk hundreds of hours into the commands lib and don't want to spend any more time on it unless absolutely necessary. Any work we would put into the commands lib should be put into replacing it. |
@olizilla I am also having problems due to
Added to https://docs.ipfs.io/reference/api/http/ in ipfs-inactive/http-api-docs#23 / ipfs-inactive/docs#368 |
The gateways get a lot of dns api http requests for things like
https://ipfs.io/api/v0/dns/www.google.com?r=true
The api returns valid json and a
500
http code. It makes it hard to spot actual errors or other 500 repsonses from go-ipfs in the logs. A404
would more closely match the situation that you asked for a dnslink resolution for a domain that does not have one.The text was updated successfully, but these errors were encountered: