Skip to content

Improve error when broken CIDv0 is used #7792

@lidel

Description

@lidel

If you make a {cidv0}.ipfs.dweb.link subdomain URL with a v0 CID, you get:

invalid ipfs path: invalid path "/ipfs/{cidv0}/": invalid CID: selected encoding not supported

Browsers force-lowercase authority part of every URI which breaks CIDv0.
That is why advise use of dweb.link/ipfs/{cidv0} as canonical link (it coverts and redirects, working around browser limitations).

Perhaps we could special-case this natively in go-ipfs, and detect that error was caused by "broken cidv0" starting with qm.. ?
That is what we already do in ipfs-companion in Firefox: ipfs/ipfs-companion#911:

At very minimum we could make text error more useful by detecting qm.. and providing more useful error suggesting to "covert CIDv0 to CIDv1 in base32 and try again"?

cc @Gozala @autonome @andrew @jessicaschilling

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementA net-new feature or improvement to an existing featureneed/triageNeeds initial labeling and prioritizationtopic/gatewayTopic gateway

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions