Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/unreleased/fix-copy-pl-spaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix: Make COPY work in public links in spaces

https://github.com/cs3org/reva/pull/5284/files
2 changes: 1 addition & 1 deletion internal/http/services/owncloud/ocdav/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (s *svc) handlePathCopy(w http.ResponseWriter, r *http.Request, ns string)
}

// For the destination, we still need to handle this ourselves
if s.c.SpacesEnabled {
if s.c.SpacesEnabled && ns != "/public" {
dstSpaceID, dstRelPath := router.ShiftPath(dst)
_, spaceRoot, ok := spaces.DecodeStorageSpaceID(dstSpaceID)
if !ok {
Expand Down
4 changes: 3 additions & 1 deletion internal/http/services/owncloud/ocdav/ocdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ func extractDestination(r *http.Request) (string, error) {
baseURI := r.Context().Value(ctxKeyBaseURI).(string)
// TODO check if path is on same storage, return 502 on problems, see https://tools.ietf.org/html/rfc4918#section-9.9.4
// Strip the base URI from the destination. The destination might contain redirection prefixes which need to be handled
return strings.TrimPrefix(dstURL.Path, baseURI), nil
destination := strings.TrimPrefix(dstURL.Path, baseURI)
return destination, nil

}

// replaceAllStringSubmatchFunc is taken from 'Go: Replace String with Regular Expression Callback'
Expand Down