|
1 | 1 | using System.Runtime.CompilerServices; |
2 | 2 | using System.Text; |
| 3 | +using System.Web; |
3 | 4 | using Genbox.SimpleS3.Core.Abstracts.Clients; |
4 | 5 | using Genbox.SimpleS3.Core.Builders; |
5 | 6 | using Genbox.SimpleS3.Core.Common.Exceptions; |
6 | 7 | using Genbox.SimpleS3.Core.Common.Misc; |
7 | 8 | using Genbox.SimpleS3.Core.Common.Validation; |
| 9 | +using Genbox.SimpleS3.Core.Enums; |
8 | 10 | using Genbox.SimpleS3.Core.Internals.Pools; |
9 | 11 | using Genbox.SimpleS3.Core.Network.Requests.Objects; |
10 | 12 | using Genbox.SimpleS3.Core.Network.Requests.S3Types; |
@@ -98,10 +100,14 @@ public static async IAsyncEnumerable<S3DeleteError> DeleteAllObjectsAsync(this I |
98 | 100 |
|
99 | 101 | if (response.IsTruncated) |
100 | 102 | { |
101 | | - string localToken = response.NextContinuationToken; |
| 103 | + string cToken = response.NextContinuationToken; |
| 104 | + |
| 105 | + if (response.EncodingType == EncodingType.Url) |
| 106 | + cToken = HttpUtility.UrlDecode(cToken); |
| 107 | + |
102 | 108 | responseTask = client.ListObjectsAsync(bucketName, req => |
103 | 109 | { |
104 | | - req.ContinuationToken = localToken; |
| 110 | + req.ContinuationToken = cToken; |
105 | 111 | configure?.Invoke(req); |
106 | 112 | }, token); |
107 | 113 | } |
@@ -163,6 +169,10 @@ public static async IAsyncEnumerable<S3DeleteError> DeleteAllObjectVersionsAsync |
163 | 169 | if (response.IsTruncated) |
164 | 170 | { |
165 | 171 | string keyMarker = response.NextKeyMarker; |
| 172 | + |
| 173 | + if (response.EncodingType == EncodingType.Url) |
| 174 | + keyMarker = HttpUtility.UrlDecode(keyMarker); |
| 175 | + |
166 | 176 | responseTask = client.ListObjectVersionsAsync(bucketName, req => |
167 | 177 | { |
168 | 178 | req.KeyMarker = keyMarker; |
@@ -264,6 +274,10 @@ public static async IAsyncEnumerable<S3Object> ListAllObjectsAsync(this IObjectC |
264 | 274 | if (response.IsTruncated) |
265 | 275 | { |
266 | 276 | string cToken = response.NextContinuationToken; |
| 277 | + |
| 278 | + if (response.EncodingType == EncodingType.Url) |
| 279 | + cToken = HttpUtility.UrlDecode(cToken); |
| 280 | + |
267 | 281 | responseTask = client.ListObjectsAsync(bucketName, req => |
268 | 282 | { |
269 | 283 | req.ContinuationToken = cToken; |
@@ -315,6 +329,10 @@ public static async IAsyncEnumerable<S3Version> ListAllObjectVersionsAsync(this |
315 | 329 | if (response.IsTruncated) |
316 | 330 | { |
317 | 331 | string keyMarker = response.NextKeyMarker; |
| 332 | + |
| 333 | + if (response.EncodingType == EncodingType.Url) |
| 334 | + keyMarker = HttpUtility.UrlDecode(keyMarker); |
| 335 | + |
318 | 336 | responseTask = client.ListObjectVersionsAsync(bucketName, req => |
319 | 337 | { |
320 | 338 | req.KeyMarker = keyMarker; |
|
0 commit comments