Skip to content

Commit

Permalink
fix(federation): Allow federation error responses to be read twice
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Nov 22, 2024
1 parent ad5f9a5 commit 15410d5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Federation/Proxy/TalkV1/ProxyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ protected function request(
try {
$body = $e->getResponse()->getBody()->getContents();
$data = json_decode($body, true, flags: JSON_THROW_ON_ERROR);
$e->getResponse()->getBody()->rewind();
if (!is_array($data)) {
throw new \RuntimeException('JSON response is not an array');
}
Expand Down

0 comments on commit 15410d5

Please sign in to comment.