mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
fix replication of checksum when encryption is enabled (#20161)
- Adding functional tests - Return checksum header on GET/HEAD, previously this was returning InvalidPartNumber error
This commit is contained in:
@@ -248,10 +248,19 @@ func checkPreconditions(ctx context.Context, w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
|
||||
// Check if the part number is correct.
|
||||
if opts.PartNumber > 1 && opts.PartNumber > len(objInfo.Parts) {
|
||||
// According to S3 we don't need to set any object information here.
|
||||
writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrInvalidPartNumber), r.URL)
|
||||
return true
|
||||
if opts.PartNumber > 1 {
|
||||
partFound := false
|
||||
for _, pi := range objInfo.Parts {
|
||||
if pi.Number == opts.PartNumber {
|
||||
partFound = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !partFound {
|
||||
// According to S3 we don't need to set any object information here.
|
||||
writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrInvalidPartNumber), r.URL)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// If-None-Match : Return the object only if its entity tag (ETag) is different from the
|
||||
|
||||
Reference in New Issue
Block a user