Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

CIDs containing "/" cannot be parsed #54

Closed
hsanjuan opened this issue Mar 7, 2022 · 5 comments
Closed

CIDs containing "/" cannot be parsed #54

hsanjuan opened this issue Mar 7, 2022 · 5 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@hsanjuan
Copy link
Contributor

hsanjuan commented Mar 7, 2022

Currently there is no way to express a path that contains a base64-formatted CID when it contains forward slashes.

Perhaps there should be a way of scaping "/" in the CID element of paths (which I think are either <CID>/path or /ipfs/<CID>/path or /ipns/<CID>/path).

@hsanjuan hsanjuan added the need/triage Needs initial labeling and prioritization label Mar 7, 2022
@ribasushi
Copy link

@hsanjuan see also ipfs/kubo#7739

I personally just switched everything I do to b64urlenc ( u multibase ), but that's hardly a generic solution

@Jorropo
Copy link

Jorropo commented Mar 7, 2022

@hsanjuan see also ipfs/go-ipfs#7739

I personally just switched everything I do to b64urlenc ( u multibase ), but that's hardly a generic solution

This came from a discourse post, where I've said the exact same thing :D
https://discuss.ipfs.io/t/how-are-base64-encoded-cids-handled-when-they-have-in-them/13656/2?u=jorropo

I guess what we want is backslash escaping of / characters. So you could use base64, if you escape /.

@thattommyhall
Copy link
Member

I should point out that I asked in the context of operating the PL gateway, where I am not in control of what people request

@markg85
Copy link

markg85 commented Mar 7, 2022

Would it not be sane to just remove the option to do base64 formatting. That format is just always going to cause troubles when used in a path context. A context that's likely in IPFS. On top of that, the proper alternative for it (b64urlenc) is there too.

I'd go as far as looking at all formatting options and kicking out all those that could break a path unintentionally.

@hacdias
Copy link
Member

hacdias commented Jun 6, 2023

This repository is no longer maintained and has been copied over to Boxo. We are now in the process of reviewing issues and PRs and moving the ones that are still relevant. This issue has been merged with a few other issues, and moved to ipfs/boxo#198.

@hacdias hacdias closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
No open projects
Archived in project
Development

No branches or pull requests

6 participants