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

URL convention is inconsistent with one recommended by IPFS #5

Closed
Kubuxu opened this issue May 2, 2016 · 6 comments
Closed

URL convention is inconsistent with one recommended by IPFS #5

Kubuxu opened this issue May 2, 2016 · 6 comments

Comments

@Kubuxu
Copy link

Kubuxu commented May 2, 2016

IPFS recommends using either canonical form. Examples:
/ipfs/Qm.... /ipns/Qm...
If protocol is required use authority less fs protocol. Examples:
fs:/ipfs/Qm.... fs:/ipns/Qm... - notice lack of double slash

See: ipfs/kubo#1678 (comment)

@ligi
Copy link
Owner

ligi commented May 2, 2016

Thanks for the hint - there is now support for fs://ipfs/ and fs://ipns/ - so that means now I just have to remove ipfs:// and ipns:// support and this can be closed? I thought fs://* is additional to ipns:// and ipfs://

@ghost
Copy link

ghost commented May 2, 2016

@ligi it should always be fs:/ipfs/and-so-on -- with one slash it's authority-less and the path is /ipfs/and-so-on as expected, while with two slashes the URI has an authority (or hostname), which is not what we want.

The same applies to the other supported but not-preferred schemas: ipfs:, web+fs:, and web+ipfs:.

Btw I'll be happy to help out whenever you run into Android+IPFS issues -- I ported cjdns to Android in the past and I know it can be a little challenging at times :)

ligi added a commit to ligi/ligi.github.com that referenced this issue May 3, 2016
@ligi
Copy link
Owner

ligi commented May 3, 2016

Interesting - first I thought this is not possible for Intent-Filters on android as the documentation states:

A URI is specified by separate attributes for each of its parts:
<scheme>://<host>:<port>[<path>|<pathPrefix>|<pathPattern>]

http://developer.android.com/guide/topics/manifest/data-element.html

But I just did some experiments and it seems to be possible to write an intent-filter to match this kind of URIs. But this has 2 drawbacks:
1: I cannot limit the intent filter to fs:/ipfs and fs:/ipns it only seems to be possible to match fs:/* - pathPattern is ignored and host like I used before to limit to fs://ipfs and fs://ipns is not working when only using one slash
2: It is off documentation and the behavior I have seen in my experiments might not be guaranteed on all devices

Just asked on StackOverflow to get some more input on this: http://stackoverflow.com/questions/36994704/intent-filters-with-pathpattern-for-authority-less-uris

@ligi ligi added the discussion label May 3, 2016
ligi added a commit that referenced this issue May 3, 2016
this is work towards closing #5
@ligi
Copy link
Owner

ligi commented May 3, 2016

I added authority-less URI support with a34a479 - but not yet feel good about the broad intent-filters for all of fs:/* - but not yet found a way around it - perhaps we should report this need upstream to android to get the ability to have narrower filters for authority-less URIs

@ghost
Copy link

ghost commented May 3, 2016

fs:/* is just fine -- more things will come in the future and /ipfs and /ipns are only the first ones.

@ligi
Copy link
Owner

ligi commented May 3, 2016

Great! then I saw problems where none is and I can close this issue as it is solved with a34a479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants