Skip to content

Commit

Permalink
#288 #457 Simplify and optimize check
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Sep 26, 2019
1 parent d527461 commit 9342a5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Runtime/LambdaRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9342a5b

Please sign in to comment.