mirror of
https://github.com/pgsty/minio.git
synced 2026-10-17 23:16:09 +03:00
fix: name the checksum algorithm in PutObject/UploadPart mismatch errors
hash.ChecksumMismatch now carries the requested algorithm (CRC32, CRC32C, SHA1, SHA256, CRC64NVME), and toAPIError renders it S3-style: The CRC32 you specified did not match the calculated checksum. instead of the generic "The provided 'x-amz-checksum' header does not match what was computed.", for all four mismatch construction sites (streaming reader, trailing-checksum decode, and both Checksum.Matches paths). Mirrors the wording already shipped for CompleteMultipartUpload in #225. Fixes #226
This commit is contained in:
@@ -74,8 +74,11 @@ func (e SizeMismatch) Error() string {
|
||||
|
||||
// ChecksumMismatch - when content checksum does not match with what was sent from client.
|
||||
type ChecksumMismatch struct {
|
||||
Want string
|
||||
Got string
|
||||
// Algorithm carries the requested checksum type (e.g. "CRC32") so API
|
||||
// error rendering can name it, matching S3's wording.
|
||||
Algorithm string
|
||||
Want string
|
||||
Got string
|
||||
}
|
||||
|
||||
func (e ChecksumMismatch) Error() string {
|
||||
|
||||
Reference in New Issue
Block a user