Skip to content

Commit 12a1c4f

Browse files
authored
Merge pull request #15 from qkdreyer/patch-3
fix: prevent type error + cast body stream as string
2 parents fcfcaec + 547c9a4 commit 12a1c4f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/ApiMapper/ApiMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public function __call($method, $arguments)
368368
"response" => $response,
369369
"parameters" => $parameters,
370370
"fields" => $fields,
371-
"body" => str_starts_with($response->getHeader('Content-Type'), 'application/json') ? json_decode($response->getBody(), true) : $response->getBody(),
371+
"body" => str_starts_with($response->getHeaderLine('Content-Type'), 'application/json') ? json_decode($response->getBody(), true) : (string) $response->getBody(),
372372
"json" => \json_last_error() === \JSON_ERROR_NONE,
373373
);
374374

0 commit comments

Comments
 (0)