Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Usage of node path.join breaks IPLD paths on Windows #99

Closed
Expyron opened this issue Oct 6, 2017 · 4 comments
Closed

Usage of node path.join breaks IPLD paths on Windows #99

Expyron opened this issue Oct 6, 2017 · 4 comments
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@Expyron
Copy link

Expyron commented Oct 6, 2017

joinPath here is returning the path separated by platform-specific path separators.

The code afterwards in the resolvers is expecting forward slashes, so it doesn't work on Windows platforms.

I suggest replacing all backslashes by slashes after joinPath on Windows platforms.

@daviddias
Copy link
Member

@Expyron that path is for IPLD Path which uses /, it should be no different in Windows.

@daviddias daviddias added kind/support A question or request for support status/ready Ready to be worked labels Oct 13, 2017
@Expyron
Copy link
Author

Expyron commented Oct 13, 2017

That's clear. I'm saying that this is not working properly on Windows.

When doing:
ipfs.dag.get(cid, 'folder/file', callback)

It works properly on Linux, but not on Windows. There's the part here that uses 'path.join()' which converts the path to 'folder\file' (with a backslash). IPLD resolvers don't understand that path with a backslash.

@daviddias
Copy link
Member

Ah! You are right, great catch! We need to keep using the Linux version, even on Windows. Would you like to patch this bug?

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue and removed kind/support A question or request for support labels Oct 13, 2017
@daviddias daviddias added the P2 Medium: Good to have, but can wait until someone steps up label Oct 18, 2017
@richardschneider
Copy link
Contributor

Fixed in PR #104

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

3 participants