-
Notifications
You must be signed in to change notification settings - Fork 100
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
fix(gateway): ipld.ErrNotFound should result in a 404 #630
Conversation
In case of blockstore restriction like with --offline or similar restriction, returning a 500 is inapropriate. It's also going back to a previous gateway behavior (at least in kubo v0.22, possibly later).
just a precaution to ensure 410 takes precedence, until we address ipfs#591
applies and tests fix from ipfs/boxo#630
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this @MichaelMure. Took bit longer to review as the semantic meaning of this ipld error type changed multiple times over the years, and we also had big refactor since v0.22, but it seems to do the trick with how things are today.
Tested in ipfs/kubo#10466 and lgtm (we had NoFetch tests that expected 500, changed them to 404).
Sharness tests failing here can be ignored (circular dep, will clear up once we ship releases in both places).
This will be included in Kubo 0.30 (ipfs/kubo#10436).
commit from upstream repo, includes ipfs/boxo#630
applies and tests fix from ipfs/boxo#630
* chore: go get -u * fix(gateway): return 404 in no-fetch contexts (#10466) applies and tests fix from ipfs/boxo#630
* fix(gateway): ipld.ErrNotFound should result in a 404 In case of blockstore restriction like with --offline or similar restriction, returning a 500 is inappropriate. It's also going back to a previous gateway behavior (at least in kubo v0.22, possibly later). * refactor(gateway): match 410 before 404s just a precaution to ensure 410 takes precedence, until we address ipfs#591 * docs: clarify 404 use case --------- Co-authored-by: Marcin Rataj <[email protected]>
Fix #593
In case of blockstore restriction like with --offline or similar restriction, returning a 500 is inapropriate.
It's also going back to a previous gateway behavior (at least in kubo v0.22, possibly later).