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

gateway: ipld.ErrNotFound should result in a 404 #593

Open
MichaelMure opened this issue Mar 25, 2024 · 0 comments
Open

gateway: ipld.ErrNotFound should result in a 404 #593

MichaelMure opened this issue Mar 25, 2024 · 0 comments
Assignees
Labels
need/triage Needs initial labeling and prioritization

Comments

@MichaelMure
Copy link
Contributor

It's a somewhat rare case, but it's possible for a gateway backend to return ipld.ErrNotFound:

In those situations, kubo v0.22.0 / boxo v0.11.0 would return a 404 in the gateway, but the implementation rework changed that to return a 500.

See also https://github.com/ipfs/boxo/pull/440/files#r1297472794

I think 404 is the correct answer, as this is not a timeout while looking for content on the p2p network, or some missing link in an IPLD node (which would mean an incorrect request). It's a definitive answer that the content does not exist.

Optionally, another status code could be returned in some more specific situations (see #591), but 404 seem to be the correct default to me.

MichaelMure@d088e1e trivially change that returned status, with no other impact as far as I can tell.

@MichaelMure MichaelMure added the need/triage Needs initial labeling and prioritization label Mar 25, 2024
@lidel lidel self-assigned this Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants