Skip to content

Commit

Permalink
fix: always rewind stream after response callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaguerre committed Jan 24, 2025
1 parent 4554c6b commit 615ff3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Tracing/HttpClient/TracedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ protected function endTracing(): void
}

\call_user_func($info['user_data']['on_response'], $this->getHeaders(false), $stream, $this->span);

if (\is_resource($stream)) {
rewind($stream);
}
}
} catch (\Throwable $e) {
Logging::getLogger()->error('There was an error during the response callback.', ['exception' => $e]);
Expand Down

0 comments on commit 615ff3f

Please sign in to comment.