Skip to content

Commit

Permalink
honor encoding-type XML response (#378)
Browse files Browse the repository at this point in the history
some vendors do not support encoding-type=url
  • Loading branch information
harshavardhana authored Mar 5, 2020
1 parent 3343393 commit 7e6312d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
23 changes: 20 additions & 3 deletions Minio/ApiEndpoints/BucketOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,33 @@ public partial class MinioClient : IBucketOperations
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();
Expand Down
1 change: 1 addition & 0 deletions Minio/DataModel/ListBucketResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ public class ListBucketResult
public string MaxKeys { get; set; }
public string Delimiter { get; set; }
public bool IsTruncated { get; set; }
public string EncodingType { get; set; }
}
}

0 comments on commit 7e6312d

Please sign in to comment.