@cryptotaxi247 / kubo / commits / 6c854ce89

unixfs/tar: Ignore /ipfs/ in path

Matt Bell committed Jan 24, 2015 at 15:04 UTC 6c854ce897922e6aacc336d4370ac3f9ca853578
1 file changed +5
unixfs/tar/reader.go
+5
@@ -6,6 +6,7 @@ import (
6 "compress/gzip"
7 "io"
8 p "path"
9 + "strings"
10
11 mdag "github.com/jbenet/go-ipfs/merkledag"
12 path "github.com/jbenet/go-ipfs/path"
@@ -27,6 +28,10 @@ type Reader struct {
28 }
29
30 func NewReader(path string, dag mdag.DAGService, resolver *path.Resolver, compression int) (*Reader, error) {
31 + if strings.HasPrefix(path, "/ipfs/") {
32 + path = path[6:]
33 + }
34 +
35 reader := &Reader{
36 signalChan: make(chan struct{}),
37 dag: dag,