Skip to content
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

Detect CID in subdomains #526

Closed
lidel opened this issue Jul 13, 2018 · 1 comment
Closed

Detect CID in subdomains #526

lidel opened this issue Jul 13, 2018 · 1 comment
Labels
area/cidv1b32 Moving to CIDv1/Base32 by default exp/novice Someone with a little familiarity can pick up good first issue Good issue for new contributors kind/enhancement A net-new feature or improvement to an existing feature
Milestone

Comments

@lidel
Copy link
Member

lidel commented Jul 13, 2018

Parent issues: ipfs/in-web-browsers#89, #527

It is possible to use cidv1b32 as a subdomain to take advantage of origin-based security perimeter in web browsers. It should be fairly easy to detect if subdomain is a valid CID, and if so, display the same UI elements as for /ipfs/<cid> paths.

@lidel lidel added kind/enhancement A net-new feature or improvement to an existing feature good first issue Good issue for new contributors exp/novice Someone with a little familiarity can pick up labels Jul 13, 2018
@lidel lidel added this to the 2018-Q3 milestone Jul 13, 2018
@ghost
Copy link

ghost commented Jul 13, 2018

In these cases, the CID will always be in a zone named ipfs (or ipns), e.g. http://bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy.ipfs.dweb.link, so a regexp could look something like ^b[^.]{42,}\.ipfs\. (42 being a made-up minimum length for a base32 CID).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cidv1b32 Moving to CIDv1/Base32 by default exp/novice Someone with a little familiarity can pick up good first issue Good issue for new contributors kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant