don't skip empty value at AssembleEntryWithAcp (#3855)
* add acl helper functionalities Signed-off-by: changlin.shi <changlin.shi@ly.com> * add tests Signed-off-by: changlin.shi <changlin.shi@ly.com> * remove 0 when create map Signed-off-by: changlin.shi <changlin.shi@ly.com> * delete when empty at `AssembleEntryWithAcp` `PutBucketAcl/PutObjectAcl` allow request with empty grants, `AssembleEntryWithAcp` shouldn't skip empty value Signed-off-by: changlin.shi <changlin.shi@ly.com> Signed-off-by: changlin.shi <changlin.shi@ly.com>
This commit is contained in:
@@ -411,6 +411,8 @@ func AssembleEntryWithAcp(objectEntry *filer_pb.Entry, objectOwner string, grant
|
||||
|
||||
if len(objectOwner) > 0 {
|
||||
objectEntry.Extended[s3_constants.ExtAmzOwnerKey] = []byte(objectOwner)
|
||||
} else {
|
||||
delete(objectEntry.Extended, s3_constants.ExtAmzOwnerKey)
|
||||
}
|
||||
|
||||
if len(grants) > 0 {
|
||||
@@ -420,6 +422,8 @@ func AssembleEntryWithAcp(objectEntry *filer_pb.Entry, objectOwner string, grant
|
||||
return s3err.ErrInvalidRequest
|
||||
}
|
||||
objectEntry.Extended[s3_constants.ExtAmzAclKey] = grantsBytes
|
||||
} else {
|
||||
delete(objectEntry.Extended, s3_constants.ExtAmzAclKey)
|
||||
}
|
||||
|
||||
return s3err.ErrNone
|
||||
|
||||
Reference in New Issue
Block a user