Skip to content

gateway: unify root identifier resolution errors #185

@lidel

Description

@lidel

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

Metadata

Metadata

Assignees

Labels

need/analysisNeeds further analysis before proceedingneed/triageNeeds initial labeling and prioritizationtopic/gatewayIssues related to HTTP Gateway

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions