Skip to content

Commit

Permalink
attempt to only remember received content when the header is in corre…
Browse files Browse the repository at this point in the history
…ct status
  • Loading branch information
indreka committed Dec 31, 2024
1 parent 06bd1bb commit 5a41682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Storage/src/Connection/Rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public function downloadObject(array $args = [])
&$attempt,
) {
// if the exception has a response for us to use
if ($e instanceof RequestException && $e->hasResponse()) {
if ($e instanceof RequestException && $e->hasResponse() && $e->getResponse()->getStatusCode() >= 200 && $e->getResponse()->getStatusCode() < 300) {
$msg = (string) $e->getResponse()->getBody();

$fetchedStream = Utils::streamFor($msg);
Expand Down

0 comments on commit 5a41682

Please sign in to comment.