Stricter partNumber checks (#17270)

Fixes #17269
This commit is contained in:
Klaus Post
2023-05-24 08:00:47 -07:00
committed by GitHub
parent 5677f73794
commit 66156b8230
4 changed files with 27 additions and 6 deletions
+21
View File
@@ -3693,6 +3693,27 @@ func testAPIPutObjectPartHandler(obj ObjectLayer, instanceType, bucketName strin
expectedAPIError: ErrInvalidAccessKeyID,
},
// Case where part number is invalid.
9: {
objectName: testObject,
content: "hello",
partNumber: "0",
fault: None,
accessKey: credentials.AccessKey,
secretKey: credentials.SecretKey,
expectedAPIError: ErrInvalidPart,
},
10: {
objectName: testObject,
content: "hello",
partNumber: "-10",
fault: None,
accessKey: credentials.AccessKey,
secretKey: credentials.SecretKey,
expectedAPIError: ErrInvalidPart,
},
}
reqV2Str := "V2 Signed HTTP request"