Skip to content

Commit f4c63d9

Browse files
committed
Use webdav protocol when creating ocm reference
1 parent 31fb861 commit f4c63d9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Bugfix: Fix createOCMReference - correct the protocol
2+
3+
https://github.com/cs3org/reva/pull/3743

internal/grpc/services/gateway/ocmshareprovider.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,19 @@ func getTransferProtocol(share *ocm.ReceivedShare) (*ocm.TransferProtocol, bool)
422422
return nil, false
423423
}
424424

425+
func getWebDAVProtocol(share *ocm.ReceivedShare) (*ocm.WebDAVProtocol, bool) {
426+
for _, p := range share.Protocols {
427+
if d, ok := p.Term.(*ocm.Protocol_WebdavOptions); ok {
428+
return d.WebdavOptions, true
429+
}
430+
}
431+
return nil, false
432+
}
433+
425434
func (s *svc) createOCMReference(ctx context.Context, share *ocm.ReceivedShare) (*rpc.Status, error) {
426435
log := appctx.GetLogger(ctx)
427436

428-
d, _ := getTransferProtocol(share)
437+
d, _ := getWebDAVProtocol(share)
429438

430439
homeRes, err := s.GetHome(ctx, &provider.GetHomeRequest{})
431440
if err != nil {

0 commit comments

Comments
 (0)