File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -140,13 +140,12 @@ Resolve the value of an IPFS DAG path:
140
140
return err
141
141
}
142
142
143
- if rp .Remainder () != "" {
144
- // TODO: js expects this error. Instead of fixing this
145
- // error, we should fix #5703.
146
- return fmt .Errorf ("found non-link at given path" )
143
+ encoded := "/" + rp .Namespace () + "/" + enc .Encode (rp .Cid ())
144
+ if remainder := rp .Remainder (); remainder != "" {
145
+ encoded += "/" + remainder
147
146
}
148
147
149
- return cmds .EmitOnce (res , & ncmd.ResolvedPath {Path : path .Path ("/" + rp . Namespace () + "/" + enc . Encode ( rp . Cid ()) )})
148
+ return cmds .EmitOnce (res , & ncmd.ResolvedPath {Path : path .Path (encoded )})
150
149
},
151
150
Encoders : cmds.EncoderMap {
152
151
cmds .Text : cmds .MakeTypedEncoder (func (req * cmds.Request , w io.Writer , rp * ncmd.ResolvedPath ) error {
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ test_resolve_cmd() {
65
65
test_resolve " /ipfs/$a_hash /b" " /ipfs/$b_hash "
66
66
test_resolve " /ipfs/$a_hash /b/c" " /ipfs/$c_hash "
67
67
test_resolve " /ipfs/$b_hash /c" " /ipfs/$c_hash "
68
+ test_resolve " /ipld/$dag_hash /a/b/c" " /ipld/$dag_hash /a/b/c"
69
+ test_resolve " /ipld/$dag_hash /a/b" " /ipld/$dag_hash /a/b"
68
70
69
71
test_resolve_setup_name " /ipfs/$a_hash "
70
72
test_resolve " /ipns/$id_hash " " /ipfs/$a_hash "
You can’t perform that action at this time.
0 commit comments