Send Partscount only when partnumber is specified (#9793)

Fixes #9789
This commit is contained in:
kannappanr
2020-06-10 09:22:15 -07:00
committed by GitHub
parent 3d3b75fb8d
commit 2c372a9894
5 changed files with 25 additions and 7 deletions
+2 -2
View File
@@ -173,9 +173,9 @@ func checkPreconditions(ctx context.Context, w http.ResponseWriter, r *http.Requ
}
// Check if the part number is correct.
if opts.PartNumber > 0 && len(objInfo.Parts) > 0 && opts.PartNumber != len(objInfo.Parts) {
if opts.PartNumber > 1 && opts.PartNumber > len(objInfo.Parts) {
writeHeaders()
writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrPreconditionFailed), r.URL, guessIsBrowserReq(r))
w.WriteHeader(http.StatusRequestedRangeNotSatisfiable)
return true
}