s3: Encode continuation & next continuation tokens when asked (#8292)

When url encoding is passed in v2 listing handler, continuationToken
and nextContinuationToken needs to be encoded. The reason is that
both represents an object name/prefix in Minio server and it could
contain a character unsupported by XML specification.
master
Anis Elleuch 5 years ago committed by kannappanr
parent 77dc2031a2
commit a790877c01
  1. 4
      cmd/api-response.go

@ -498,8 +498,8 @@ func generateListObjectsV2Response(bucket, prefix, token, nextToken, startAfter,
data.Delimiter = s3EncodeName(delimiter, encodingType) data.Delimiter = s3EncodeName(delimiter, encodingType)
data.Prefix = s3EncodeName(prefix, encodingType) data.Prefix = s3EncodeName(prefix, encodingType)
data.MaxKeys = maxKeys data.MaxKeys = maxKeys
data.ContinuationToken = token data.ContinuationToken = s3EncodeName(token, encodingType)
data.NextContinuationToken = nextToken data.NextContinuationToken = s3EncodeName(nextToken, encodingType)
data.IsTruncated = isTruncated data.IsTruncated = isTruncated
for _, prefix := range prefixes { for _, prefix := range prefixes {
var prefixItem = CommonPrefix{} var prefixItem = CommonPrefix{}

Loading…
Cancel
Save