Skip to content

Commit dc80705

Browse files
fix(DMD-987): check isSeekable() before calling rewind()
- Add isSeekable() check before rewinding response body stream - Prevents potential errors with non-seekable streams Co-Authored-By: Martin Zajic <ja@mzajic.cz>
1 parent e6f67af commit dc80705

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Keboola/StorageApi/HandlerStack.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ private static function createDefaultDecider(int $maxRetries, bool $retryOnMaint
8282
private static function isVersionConflictResponse(ResponseInterface $response): bool
8383
{
8484
$body = (string) $response->getBody();
85-
$response->getBody()->rewind();
85+
if ($response->getBody()->isSeekable()) {
86+
$response->getBody()->rewind();
87+
}
8688

8789
$data = json_decode($body, true);
8890
if (!is_array($data)) {

0 commit comments

Comments
 (0)