Skip to content

Commit

Permalink
Merge pull request #12 from tiny-blocks/release/2.1.2
Browse files Browse the repository at this point in the history
Release/2.1.2
  • Loading branch information
gustavofreze committed Jun 13, 2023
2 parents 09689b9 + a8f55b3 commit 14588cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Internal/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ private function __construct(

public static function from(HttpCode $code, mixed $data, array $headers): ResponseInterface
{
$headers = empty($headers) ? ['Content-Type' => 'application/json'] : $headers;
if (empty($headers)) {
$headers[] = ['Content-Type' => 'application/json'];
}

return new Response(code: $code, body: StreamFactory::from(data: $data), headers: $headers);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/HttpResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class HttpResponseTest extends TestCase
{
private array $defaultHeader = ['Content-Type' => 'application/json'];
private array $defaultHeader = [['Content-Type' => 'application/json']];

/**
* @dataProvider providerData
Expand Down

0 comments on commit 14588cf

Please sign in to comment.