From 9342a5bed9c2d44eaf76f7a36cb365a4595f7323 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Thu, 26 Sep 2019 14:10:21 +0200 Subject: [PATCH] #288 #457 Simplify and optimize check --- src/Runtime/LambdaRuntime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runtime/LambdaRuntime.php b/src/Runtime/LambdaRuntime.php index 4ce1e13bb..e97400e07 100755 --- a/src/Runtime/LambdaRuntime.php +++ b/src/Runtime/LambdaRuntime.php @@ -251,7 +251,7 @@ private function postJson(string $url, $data): void * - else we encode all other responses to base64 * API Gateway checks `isBase64Encoded` and decodes what we returned if necessary. */ - if ($contentType && $contentType !== 'application/json' && substr($contentType, 0, 5) !== 'text/') { + if ($contentType && $contentType !== 'application/json' && strpos($contentType, 'text/') !== 0) { $data['body'] = base64_encode($data['body']); $data['isBase64Encoded'] = true; }