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; }