Skip to content

Commit

Permalink
Merge pull request #160 from prismicio/develop
Browse files Browse the repository at this point in the history
Cast to string response body
  • Loading branch information
debiasio authored Sep 24, 2018
2 parents 22146cf + 5724c35 commit 03aebd0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
65 changes: 34 additions & 31 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Prismic/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function previewSession(string $token, LinkResolver $linkResolver, string
throw Exception\RequestFailureException::fromGuzzleException($guzzleException);
}
/** @var \Psr\Http\Message\ResponseInterface $response */
$response = \json_decode($response->getBody());
$response = \json_decode((string) $response->getBody());
if (isset($response->mainDocument)) {
$documents = $this
->query(Predicates::at("document.id", $response->mainDocument), ['ref' => $token, 'lang' => '*'])
Expand Down

0 comments on commit 03aebd0

Please sign in to comment.