Skip to content

Commit

Permalink
rename files
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Feb 13, 2024
1 parent 1786a6b commit 063b355
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/http/services/owncloud/ocdav/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/pkg/appctx"
"github.com/cs3org/reva/pkg/rhttp/router"
"github.com/cs3org/reva/pkg/spaces"
"github.com/cs3org/reva/pkg/utils/resourceid"
"github.com/rs/zerolog"
)
Expand All @@ -42,6 +43,11 @@ func (s *svc) handlePathMove(w http.ResponseWriter, r *http.Request, ns string)
return
}

head, rel := router.ShiftPath(dstPath)
if _, base, ok := spaces.DecodeSpaceID(head); ok {
dstPath = path.Join(base, rel)
}

for _, r := range nameRules {
if !r.Test(dstPath) {
w.WriteHeader(http.StatusBadRequest)
Expand Down

0 comments on commit 063b355

Please sign in to comment.