Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit d3ad40b

Browse files
StebalienAlan Shaw
authored and
Alan Shaw
committed
fix: don't expect ipfs to preserve a leading slash (#440)
Go-ipfs now normalizes paths before adding files. This will: * remove any leading slashes. * remove any `/./` components. * normalize any `/../` components. That breaks this test which assumes that paths are returned _exactly_ as specified.
1 parent d3dbd6f commit d3ad40b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/miscellaneous/resolve.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = (createCommon, options) => {
7171

7272
// Test resolve turns /ipfs/QmRootHash/path/to/file into /ipfs/QmFileHash
7373
it('should resolve an IPFS path link', (done) => {
74-
const path = '/path/to/testfile.txt'
74+
const path = 'path/to/testfile.txt'
7575
const content = loadFixture('test/fixtures/testfile.txt', 'interface-ipfs-core')
7676

7777
ipfs.add([{ path, content }], { wrapWithDirectory: true }, (err, res) => {
@@ -80,7 +80,7 @@ module.exports = (createCommon, options) => {
8080
const rootHash = res.find(r => r.path === '').hash
8181
const fileHash = res.find(r => r.path === path).hash
8282

83-
ipfs.resolve(`/ipfs/${rootHash}${path}`, (err, path) => {
83+
ipfs.resolve(`/ipfs/${rootHash}/${path}`, (err, path) => {
8484
expect(err).to.not.exist()
8585
expect(path).to.equal(`/ipfs/${fileHash}`)
8686
done()

0 commit comments

Comments
 (0)