Skip to content

Commit b54d1d4

Browse files
committed
1 parent e73309b commit b54d1d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/mfs.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ module.exports = function (node) {
2222

2323
bufferStream.on('end', function () {
2424
// nested, must make sure we have all the dirs along the way
25-
if (opts.key.indexOf('/')) {
25+
// https://github.com/ipfs/ipfs-blob-store/pull/5#discussion_r44748249
26+
if (opts.key[0] === '/') {
27+
opts.key = opts.key.slice(1)
28+
}
29+
if (opts.key.indexOf('/') > -1) {
2630
var dirPath = opts.key.split('/')
2731
dirPath.pop()
2832
dirPath = dirPath.join('/')

0 commit comments

Comments
 (0)