From 8667e9f821f22a68a0d6ef073120116ae5d8c8b1 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Sun, 11 Aug 2024 17:56:02 +0530 Subject: [PATCH] Make application/json as default --- app/controllers/api/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 7139afa626..00b5c10656 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1952,12 +1952,12 @@ App::post('/v1/functions/:functionId/executions') $execution->setAttribute('responseBody', $executionResponse['body'] ?? ''); $execution->setAttribute('responseHeaders', $headers); - $isJson = false; + $isJson = true; $acceptTypes = \explode(', ', $request->getHeader('accept', 'application/json')); foreach ($acceptTypes as $acceptType) { - if (\str_starts_with($acceptType, 'application/json') || \str_starts_with($acceptType, 'application/*')) { - $isJson = true; + if (\str_starts_with($acceptType, 'multipart/form-data') || \str_starts_with($acceptType, 'multipart/*')) { + $isJson = false; break; } }