Skip to content

Commit

Permalink
[9.x] Fixes HTTP::pool response when a URL returns a null status code (
Browse files Browse the repository at this point in the history
…#41412)

* Fixes HTTP::pool response when a URL returns a null status code

* Updated getResponse() to hasResponse()

Co-authored-by: Bogdan Kharchenko <32746389+bogdankharchenko@users.noreply.github.com>

Co-authored-by: Bogdan Kharchenko <32746389+bogdankharchenko@users.noreply.github.com>
  • Loading branch information
sulemaanhamza and bogdankharchenko committed Mar 10, 2022
1 parent c3195b3 commit 6ed5918
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Http/Client/PendingRequest.php
Expand Up @@ -790,7 +790,7 @@ protected function makePromise(string $method, string $url, array $options = [])
});
})
->otherwise(function (TransferException $e) {
return $e instanceof RequestException ? $this->populateResponse(new Response($e->getResponse())) : $e;
return $e instanceof RequestException && $e->hasResponse() ? $this->populateResponse(new Response($e->getResponse())) : $e;
});
}

Expand Down

0 comments on commit 6ed5918

Please sign in to comment.