Skip to content

Commit

Permalink
Fix inconsistent content type when using ResponseSequence (#43051)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksassnowski authored Jul 5, 2022
1 parent 57c5672 commit 6de62a6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions src/Illuminate/Http/Client/ResponseSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public function __construct(array $responses)
*/
public function push($body = null, int $status = 200, array $headers = [])
{
$body = is_array($body) ? json_encode($body) : $body;

return $this->pushResponse(
Factory::response($body, $status, $headers)
);
Expand Down
1 change: 1 addition & 0 deletions tests/Http/HttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ public function testSequenceBuilder()

$response = $this->factory->get('https://example.com');
$this->assertSame(['fact' => 'Cats are great!'], $response->json());
$this->assertSame('application/json', $response->header('Content-Type'));
$this->assertSame(200, $response->status());

$response = $this->factory->get('https://example.com');
Expand Down

0 comments on commit 6de62a6

Please sign in to comment.