Skip to content
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

/api/v0/dns/ should return HTTP 200 for domains without DNSLink #5933

Closed
da2x opened this issue Jan 20, 2019 · 2 comments
Closed

/api/v0/dns/ should return HTTP 200 for domains without DNSLink #5933

da2x opened this issue Jan 20, 2019 · 2 comments
Labels
status/duplicate This issue or pull request already exists

Comments

@da2x
Copy link
Contributor

da2x commented Jan 20, 2019

Version information:

go-ipfs version: 0.4.18-
Repo version: 7
System version: amd64/windows
Golang version: go1.11.1

Type:

bug

Description:

http://127.0.0.1:5001/api/v0/dns/example.com returns HTTP 500 Internal Server Error (meaning that the API server failed to fulfill the request) even for successful requests. The body clarifies that the request actually worked as expected: {"Message":"could not resolve name","Code":0,"Type":"error"}.

The expected response code is HTTP 200 OK as everything worked as expected. The API call did actually succeed and return the expected result.

@agowa
Copy link

agowa commented Jan 12, 2020

I'd be against HTTP-200 as that would be misleading as well, better fits would be:

  • 204 - no content
  • 422 - Unprocessable Entity

I'd suggest using 204, as that one clearly indicates that the API itself is OK but that no ipfs content could be found for the requested dns entry. Therefore no body parsing is required, and load on server and client can be minimized, as only the http status needs to be checked.

@Stebalien Stebalien added the status/duplicate This issue or pull request already exists label Jan 13, 2020
@Stebalien
Copy link
Member

See: #6746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants