From e98291667e94c8b5235d0298493a6bb982c8cf6e Mon Sep 17 00:00:00 2001 From: vamsii777 Date: Fri, 20 Dec 2024 04:42:48 +0530 Subject: [PATCH] Increase maximum response data size in APIHandler to 100MB for improved data handling during downloads. --- Sources/JuspayKit/Core/APIHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/JuspayKit/Core/APIHandler.swift b/Sources/JuspayKit/Core/APIHandler.swift index 2a2c504..90fc407 100644 --- a/Sources/JuspayKit/Core/APIHandler.swift +++ b/Sources/JuspayKit/Core/APIHandler.swift @@ -113,7 +113,7 @@ actor JuspayAPIHandler { request.body = body let response = try await httpClient.execute(request, timeout: .seconds(60)) - let responseData = try await response.body.collect(upTo: .max) + let responseData = try await response.body.collect(upTo: 1024 * 1024 * 100) // 500mb to account for data downloads. guard response.status == .ok else { let error = try decoder.decode(JuspayError.self, from: responseData)