mirror of
https://github.com/versity/versitygw.git
synced 2026-09-19 06:32:10 +00:00
fix: Makes the crc64nvme checksum as default for PutObject, even if no checksum is provided
Fixes #1182 S3 calculates the `CRC64NVME` checksum of an object on object upload(`PutObject`), when no checksum algorithm or precalculated checksum header is provided. Makes the `CRC64NVME` checksum as default for `PutObject`, when no checksum is provided.
This commit is contained in:
@@ -2668,6 +2668,10 @@ func (p *Posix) PutObject(ctx context.Context, po s3response.PutObjectInput) (s3
|
||||
if po.Key == nil {
|
||||
return s3response.PutObjectOutput{}, s3err.GetAPIError(s3err.ErrNoSuchKey)
|
||||
}
|
||||
// Override the checksum algorithm with default: CRC64NVME
|
||||
if po.ChecksumAlgorithm == "" {
|
||||
po.ChecksumAlgorithm = types.ChecksumAlgorithmCrc64nvme
|
||||
}
|
||||
_, err := os.Stat(*po.Bucket)
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
return s3response.PutObjectOutput{}, s3err.GetAPIError(s3err.ErrNoSuchBucket)
|
||||
|
||||
Reference in New Issue
Block a user