Browse Source
honor encoding-type XML response (#378)
some vendors do not support encoding-type=url
pull/381/head
3.1.10
Harshavardhana
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
21 additions and
3 deletions
-
Minio/ApiEndpoints/BucketOperations.cs
-
Minio/DataModel/ListBucketResult.cs
|
|
@ -159,16 +159,33 @@ namespace Minio |
|
|
|
foreach (Item item in result.Item2) |
|
|
|
{ |
|
|
|
lastItem = item; |
|
|
|
item.Key = HttpUtility.UrlDecode(item.Key); |
|
|
|
if (result.Item1.EncodingType == "url") |
|
|
|
{ |
|
|
|
item.Key = HttpUtility.UrlDecode(item.Key); |
|
|
|
} |
|
|
|
obs.OnNext(item); |
|
|
|
} |
|
|
|
if (result.Item1.NextMarker != null) |
|
|
|
{ |
|
|
|
marker = HttpUtility.UrlDecode(result.Item1.NextMarker); |
|
|
|
if (result.Item1.EncodingType == "url") |
|
|
|
{ |
|
|
|
marker = HttpUtility.UrlDecode(result.Item1.NextMarker); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
marker = result.Item1.NextMarker; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (lastItem != null) |
|
|
|
{ |
|
|
|
marker = HttpUtility.UrlDecode(lastItem.Key); |
|
|
|
if (result.Item1.EncodingType == "url") |
|
|
|
{ |
|
|
|
marker = HttpUtility.UrlDecode(lastItem.Key); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
marker = lastItem.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
isRunning = result.Item1.IsTruncated; |
|
|
|
cts.Token.ThrowIfCancellationRequested(); |
|
|
|
|
|
@ -32,5 +32,6 @@ namespace Minio.DataModel |
|
|
|
public string MaxKeys { get; set; } |
|
|
|
public string Delimiter { get; set; } |
|
|
|
public bool IsTruncated { get; set; } |
|
|
|
public string EncodingType { get; set; } |
|
|
|
} |
|
|
|
} |