Skip to content

Commit

Permalink
fix public share paths (#2580)
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar authored Feb 23, 2022
1 parent 2056f9d commit 863b117
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-public-share-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Public shares path needs to be set

We need to set the relative path to the space root for public link shares to identify them in the shares list.

https://github.com/owncloud/ocis/issues/2462
https://github.com/cs3org/reva/pull/2580
Original file line number Diff line number Diff line change
Expand Up @@ -1064,12 +1064,11 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf
s.Path = strings.TrimPrefix(s.Path, h.getHomeNamespace(u))
}
}

case s.ShareType == conversions.ShareTypePublicLink:
s.FileTarget = path.Join("/", path.Base(info.Path))
s.Path = path.Join("/", path.Base(info.Path))
default:
s.FileTarget = path.Join(h.sharePrefix, path.Base(info.Path))
if s.ShareType == conversions.ShareTypePublicLink {
s.FileTarget = path.Join("/", path.Base(info.Path))
}
s.Path = info.Path
client, err := pool.GetGatewayServiceClient(h.gatewayAddr)
if err == nil {
Expand Down

0 comments on commit 863b117

Please sign in to comment.