diff --git a/weed/s3api/s3api_acp.go b/weed/s3api/s3api_acp.go index fbbf2d080..ca79cb6d2 100644 --- a/weed/s3api/s3api_acp.go +++ b/weed/s3api/s3api_acp.go @@ -61,19 +61,14 @@ func (s3a *S3ApiServer) checkAccessForWriteObject(r *http.Request, bucket, objec }, } if len(grants) == 0 { - // set default grants - s3acl.SetAcpOwnerHeader(r, accountId) - s3acl.SetAcpGrantsHeader(r, []*s3.Grant{bucketOwnerFullControlGrant}) return s3err.ErrNone } - if !s3acl.GrantEquals(bucketOwnerFullControlGrant, grants[0]) { - return s3err.AccessControlListNotSupported + if s3acl.GrantEquals(bucketOwnerFullControlGrant, grants[0]) { + return s3err.ErrNone } - s3acl.SetAcpOwnerHeader(r, accountId) - s3acl.SetAcpGrantsHeader(r, []*s3.Grant{bucketOwnerFullControlGrant}) - return s3err.ErrNone + return s3err.AccessControlListNotSupported } //bucket access allowed