Skip to content

Commit

Permalink
Fix http response for all php version
Browse files Browse the repository at this point in the history
  • Loading branch information
vfalies committed Mar 28, 2020
1 parent 9b7956d commit e812aa6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/VfacTmdb/Tmdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,11 @@ protected function sendRequest(string $method, string $url, array $form_params =
*/
private function decodeRequest($res, $method, $url, $form_params) : \stdClass
{
$content = $res->getBody()->getContents();
$content = $res->getBody();

if ( ! is_string($content)) {
$content = $content->getContents();
}
if (empty($content)) {
$this->logger->error('Request Body empty', array('method' => $method, 'url' => $url, 'form_params' => $form_params));
throw new ServerErrorException();
Expand Down

0 comments on commit e812aa6

Please sign in to comment.