Skip to content

Commit 6ed5918

Browse files
[9.x] Fixes HTTP::pool response when a URL returns a null status code (#41412)
* Fixes HTTP::pool response when a URL returns a null status code * Updated getResponse() to hasResponse() Co-authored-by: Bogdan Kharchenko <[email protected]> Co-authored-by: Bogdan Kharchenko <[email protected]>
1 parent c3195b3 commit 6ed5918

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Http/Client/PendingRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ protected function makePromise(string $method, string $url, array $options = [])
790790
});
791791
})
792792
->otherwise(function (TransferException $e) {
793-
return $e instanceof RequestException ? $this->populateResponse(new Response($e->getResponse())) : $e;
793+
return $e instanceof RequestException && $e->hasResponse() ? $this->populateResponse(new Response($e->getResponse())) : $e;
794794
});
795795
}
796796

0 commit comments

Comments
 (0)