generated from ipfs/ipfs-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 153
Closed
Labels
need/analysisNeeds further analysis before proceedingNeeds further analysis before proceedingneed/triageNeeds initial labeling and prioritizationNeeds initial labeling and prioritizationtopic/gatewayIssues related to HTTP GatewayIssues related to HTTP Gateway
Description
Extracted from ipfs/kubo#9660 (review) so we dont forget
I was thinking about this again, both from semantic perspective, but also given your feedback on how hairy this gets.
I am leaning towards returning 500s for all invalid root identifiers, just for the sake of consistency and simplicity
@hacdias would like to hear your thoughts if below makes sense (if you dont have any concerns, feel free to execute on this):
/ipfs/this-is-not-a-cid→ we were thinking about 400 Bad Request, but it may be better/easier to return 500 Server Error, because maybe today we know this CID is not valid, but in 10 years the same software could be wrong? Maybe it is a valid CIDv8 that this old software can't recognize? 400 could be wrong, 500 will always kinda fit./ipns/this-domain-does-not-exist→ 500 (we dont know if domain does not exist, or was resolution error)/ipns/{cid-libp2p-key-that-cant-be-resolved}→ 500 (if it is a valid key, resolution error, if not, we will fallbck to dnslink, and that also cant be proven negative)
TLDR
Return HTTP 500 Server Error for all /ip[nf]s/id failures.
TODO
- PR here: fix(gateway): return 500 for all /ip[nf]s/id failures #187
- Side-quest:
IsErrNotFoundfunc probably should not haverouting.ErrNotFound, because these errors are for /ipns/id, which is we always want to be 500.
- Side-quest:
- PR in Kubo and tests passing: feat(gateway): error handling improvements (500, 502, 504) kubo#9660
- PR against ipfs/specs, documenting this behavior Return 500 on resolution errors specs#380
Reactions are currently unavailable
Metadata
Metadata
Labels
need/analysisNeeds further analysis before proceedingNeeds further analysis before proceedingneed/triageNeeds initial labeling and prioritizationNeeds initial labeling and prioritizationtopic/gatewayIssues related to HTTP GatewayIssues related to HTTP Gateway