From 21f74b5496a6701716c4ee80b9cb06e51cec79ab Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 5 May 2022 15:26:00 +1200 Subject: [PATCH] Collect body bytes --- templates/swift/Sources/Client.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index f489f4b63..4c7625199 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -285,7 +285,7 @@ open class Client { case is Bool.Type: return true as! T case is ByteBuffer.Type: - return response.body as! T + return try await response.body.collect(upTo: Int.max) as! T default: let data = try await response.body.collect(upTo: Int.max) let dict = try JSONSerialization.jsonObject(with: data) as? [String: Any]