Minio handle for list_objects_v2 with a blank ContinuationToken (#5940)

minio will now return an error for a blank continuation token in list_objects_v2,so as in s3.

Fixes #5931
This commit is contained in:
Praveen raj Mani
2018-06-26 01:05:43 +05:30
committed by kannappanr
parent 0bbdd02a57
commit 5fbdd70de9
4 changed files with 51 additions and 4 deletions

View File

@@ -36,7 +36,17 @@ func getListObjectsV1Args(values url.Values) (prefix, marker, delimiter string,
}
// Parse bucket url queries for ListObjects V2.
func getListObjectsV2Args(values url.Values) (prefix, token, startAfter, delimiter string, fetchOwner bool, maxkeys int, encodingType string) {
func getListObjectsV2Args(values url.Values) (prefix, token, startAfter, delimiter string, fetchOwner bool, maxkeys int, encodingType string, errCode APIErrorCode) {
errCode = ErrNone
// The continuation-token cannot be empty.
if val, ok := values["continuation-token"]; ok {
if len(val[0]) == 0 {
errCode = ErrIncorrectContinuationToken
return
}
}
prefix = values.Get("prefix")
token = values.Get("continuation-token")
startAfter = values.Get("start-after")