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
parent
commit
7e6312d0e7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      Minio/ApiEndpoints/BucketOperations.cs
  2. 1
      Minio/DataModel/ListBucketResult.cs

17
Minio/ApiEndpoints/BucketOperations.cs

@ -159,17 +159,34 @@ namespace Minio
foreach (Item item in result.Item2)
{
lastItem = item;
if (result.Item1.EncodingType == "url")
{
item.Key = HttpUtility.UrlDecode(item.Key);
}
obs.OnNext(item);
}
if (result.Item1.NextMarker != null)
{
if (result.Item1.EncodingType == "url")
{
marker = HttpUtility.UrlDecode(result.Item1.NextMarker);
}
else
{
marker = result.Item1.NextMarker;
}
}
else if (lastItem != null)
{
if (result.Item1.EncodingType == "url")
{
marker = HttpUtility.UrlDecode(lastItem.Key);
}
else
{
marker = lastItem.Key;
}
}
isRunning = result.Item1.IsTruncated;
cts.Token.ThrowIfCancellationRequested();
}

1
Minio/DataModel/ListBucketResult.cs

@ -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; }
}
}
Loading…
Cancel
Save