4
4
"context"
5
5
"errors"
6
6
logging "gx/ipfs/QmRREK2CAZ5Re2Bd9zZFG6FeYDppUWt5cMgsoUEp3ktgSr/go-log"
7
+ gopath "path"
7
8
"strings"
8
9
"time"
9
10
@@ -106,7 +107,7 @@ func (fn *ipnsNode) Resolve(path string) (string, error) {
106
107
keys , err = fn .core .Key ().List (fn .ctx )
107
108
if err != nil {
108
109
log .Errorf ("IPNS - Key err: %v" , err )
109
- return "" , nil //TODO
110
+ return "" , err
110
111
}
111
112
}
112
113
@@ -119,7 +120,7 @@ func (fn *ipnsNode) Resolve(path string) (string, error) {
119
120
for _ , key := range keys {
120
121
if key .Name () == keyName {
121
122
log .Debugf ("IPNS key %q found" , keyName )
122
- //FIXME: in the real world, we need to use a (stripped) key.Path()
123
+ //FIXME: in the real world, we need to use a key.Path(), not a pretty printer
123
124
return strings .Replace (path , keyName , key .ID ().Pretty (), 1 ), nil
124
125
}
125
126
}
@@ -139,6 +140,7 @@ func (mfsNode) Mutable() bool {
139
140
140
141
//TODO: review
141
142
func (fn * mfsNode ) Resolve (path string ) (string , error ) {
143
+ log .Debugf ("MFSResolve - Request %q" , path )
142
144
fsn , err := mfs .Lookup (fn .filesRoot , strings .TrimPrefix (path , "/local" ))
143
145
if err != nil {
144
146
return "" , err
@@ -148,7 +150,9 @@ func (fn *mfsNode) Resolve(path string) (string, error) {
148
150
if err != nil {
149
151
return "" , err
150
152
}
151
- return mfsNode .String (), nil
153
+
154
+ //TODO: check API, see if prefixed paths are ever returned; /ipns, ipld, etc.
155
+ return gopath .Join ("/ipfs/" , mfsNode .String ()), nil
152
156
}
153
157
154
158
type fuseNode struct {
0 commit comments