From f16989a5b5bd5c6d769bfaff7e6ae076dc2d3ba5 Mon Sep 17 00:00:00 2001 From: Florian Mari Date: Sun, 26 May 2024 15:05:07 +0200 Subject: [PATCH] fix(storage): list method using wrong encoder (#405) --- Sources/Storage/StorageFileApi.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Storage/StorageFileApi.swift b/Sources/Storage/StorageFileApi.swift index efce0b56..61aef97c 100644 --- a/Sources/Storage/StorageFileApi.swift +++ b/Sources/Storage/StorageFileApi.swift @@ -320,6 +320,8 @@ public class StorageFileApi: StorageApi { path: String? = nil, options: SearchOptions? = nil ) async throws -> [FileObject] { + let encoder = JSONEncoder() + var options = options ?? DEFAULT_SEARCH_OPTIONS options.prefix = path ?? "" @@ -327,7 +329,7 @@ public class StorageFileApi: StorageApi { HTTPRequest( url: configuration.url.appendingPathComponent("object/list/\(bucketId)"), method: .post, - body: configuration.encoder.encode(options) + body: encoder.encode(options) ) ) .decoded(decoder: configuration.decoder)