Skip to content

Commit f16989a

Browse files
authored
fix(storage): list method using wrong encoder (#405)
1 parent dcada1a commit f16989a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Storage/StorageFileApi.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,16 @@ public class StorageFileApi: StorageApi {
320320
path: String? = nil,
321321
options: SearchOptions? = nil
322322
) async throws -> [FileObject] {
323+
let encoder = JSONEncoder()
324+
323325
var options = options ?? DEFAULT_SEARCH_OPTIONS
324326
options.prefix = path ?? ""
325327

326328
return try await execute(
327329
HTTPRequest(
328330
url: configuration.url.appendingPathComponent("object/list/\(bucketId)"),
329331
method: .post,
330-
body: configuration.encoder.encode(options)
332+
body: encoder.encode(options)
331333
)
332334
)
333335
.decoded(decoder: configuration.decoder)

0 commit comments

Comments
 (0)