Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
772deca3
Commit
772deca3
authored
Jul 21, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix resolving links in sharded directories on gateway
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
1dede1b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
path/resolver/resolver.go
path/resolver/resolver.go
+10
-4
No files found.
path/resolver/resolver.go
View file @
772deca3
...
...
@@ -69,19 +69,25 @@ func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath path.Path) (ipld
}
for
len
(
p
)
>
0
{
val
,
rest
,
err
:=
nd
.
Resolve
(
p
)
lnk
,
rest
,
err
:=
r
.
Resolve
Once
(
ctx
,
r
.
DAG
,
nd
,
p
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
switch
val
:=
val
.
(
type
)
{
case
*
ipld
.
Link
:
next
,
err
:=
val
.
GetNode
(
ctx
,
r
.
DAG
)
if
lnk
!=
nil
{
next
,
err
:=
lnk
.
GetNode
(
ctx
,
r
.
DAG
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
nd
=
next
p
=
rest
continue
}
val
,
rest
,
err
:=
nd
.
Resolve
(
p
)
switch
val
.
(
type
)
{
case
*
ipld
.
Link
:
return
nil
,
nil
,
errors
.
New
(
"inconsistent ResolveOnce / nd.Resolve"
)
default
:
return
nd
,
p
,
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment