forked from TrueCloudLab/frostfs-s3-gw
[#93] Object ETag support
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
b565045649
commit
a6ec27b40d
6 changed files with 26 additions and 12 deletions
|
@ -142,6 +142,14 @@ func (n *layer) objectPut(ctx context.Context, p *PutObjectParams) (*ObjectInfo,
|
|||
return nil, err
|
||||
}
|
||||
|
||||
addr := object.NewAddress()
|
||||
addr.SetObjectID(oid)
|
||||
addr.SetContainerID(bkt.CID)
|
||||
meta, err := n.objectHead(ctx, addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &ObjectInfo{
|
||||
id: oid,
|
||||
|
||||
|
@ -152,6 +160,7 @@ func (n *layer) objectPut(ctx context.Context, p *PutObjectParams) (*ObjectInfo,
|
|||
Created: time.Now(),
|
||||
Headers: p.Header,
|
||||
ContentType: r.contentType,
|
||||
HashSum: meta.PayloadChecksum().String(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue