Skip to content

Commit

Permalink
feat: fix headers
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Dec 12, 2023
1 parent e315087 commit de07995
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Core/Http/Respond.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,19 @@ class Respond
*
* @param string|null $content
* @param int $code
* @param array $header
* @param array $headers
* @param string $version
* @return void
*/
public function __construct(string|null $content = null, int $code = Respond::HTTP_OK, array $header = [], string $version = '1.1')
public function __construct(string|null $content = null, int $code = Respond::HTTP_OK, array $headers = [], string $version = '1.1')
{
$this->code = $code;
$this->headers = new Header($header);
$this->headers->set('Content-Type', 'text/html');
$this->headers->set('Date', gmdate(DateTimeInterface::RFC7231));
$this->headers = new Header([
'Content-Type' => 'text/html',
'Date' => gmdate(DateTimeInterface::RFC7231),
...$headers
]);

$this->content = $content;
$this->version = $version;
$this->message = $this->codeHttpMessage($code);
Expand Down

0 comments on commit de07995

Please sign in to comment.