From e8b5f9d97c276da8791a0463766e1fd963a981cb Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Tue, 6 Sep 2022 10:20:40 +0200 Subject: [PATCH] fix if-match logic during InitiateFileUpload --- changelog/unreleased/jsoncs3-load.md | 3 ++- internal/grpc/services/storageprovider/storageprovider.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog/unreleased/jsoncs3-load.md b/changelog/unreleased/jsoncs3-load.md index a804928ffc..c3016cc130 100644 --- a/changelog/unreleased/jsoncs3-load.md +++ b/changelog/unreleased/jsoncs3-load.md @@ -2,4 +2,5 @@ Enhancement: cs3 to jsoncs3 share manager migration We added a Load() to the jsoncs3 and Dump() to the sc3 share manager. The shareid might need to be prefixed with a storageid and space id. -https://github.com/cs3org/reva/pull/3171 \ No newline at end of file +https://github.com/cs3org/reva/pull/3171 +https://github.com/cs3org/reva/pull/3195 diff --git a/internal/grpc/services/storageprovider/storageprovider.go b/internal/grpc/services/storageprovider/storageprovider.go index 2295a14634..931ca9c5fa 100644 --- a/internal/grpc/services/storageprovider/storageprovider.go +++ b/internal/grpc/services/storageprovider/storageprovider.go @@ -289,8 +289,9 @@ func (s *service) InitiateFileDownload(ctx context.Context, req *provider.Initia } func validateIfMatch(ifMatch string, info *provider.ResourceInfo) bool { - return ifMatch != info.GetEtag() + return ifMatch == info.GetEtag() } + func validateIfUnmodifiedSince(ifUnmodifiedSince *typesv1beta1.Timestamp, info *provider.ResourceInfo) bool { switch { case ifUnmodifiedSince == nil || info.GetMtime() == nil: