forked from TrueCloudLab/frostfs-s3-gw
[#431] Fix ETag value
ETag is a string with SHA256 of NeoFS object payload. Hash is taken from object header by neofs-sdk-go getter. Checksum type in neofs-sdk-go has changes `String()` output from `<hash>` to `SHA256:<hash>` in latest update. S3 gateway should not be relied on unstable string format implementations and use raw value. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
1c33f06bfe
commit
b778c2e072
3 changed files with 6 additions and 3 deletions
|
@ -2,6 +2,7 @@ package layer
|
|||
|
||||
import (
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
@ -260,7 +261,7 @@ func (n *layer) PutObject(ctx context.Context, p *PutObjectParams) (*data.Object
|
|||
CreationEpoch: meta.CreationEpoch(),
|
||||
Headers: p.Header,
|
||||
ContentType: p.Header[api.ContentType],
|
||||
HashSum: payloadChecksum.String(),
|
||||
HashSum: hex.EncodeToString(payloadChecksum.Value()),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue