diff --git a/src/core/FastCGI/HttpResponse.php b/src/core/FastCGI/HttpResponse.php index db4fd26..8765c3b 100644 --- a/src/core/FastCGI/HttpResponse.php +++ b/src/core/FastCGI/HttpResponse.php @@ -33,7 +33,7 @@ class HttpResponse extends Response public function __construct(array $records = []) { parent::__construct($records); - $body = (string) $this->getBody(); + $body = $this->getBody(); if (strlen($body) === 0) { return; } diff --git a/src/core/FastCGI/Message.php b/src/core/FastCGI/Message.php index 745f03c..6d299c0 100644 --- a/src/core/FastCGI/Message.php +++ b/src/core/FastCGI/Message.php @@ -58,7 +58,7 @@ public function getBody(): string return $this->body; } - public function withBody($body): self + public function withBody(string|\Stringable $body): self { $this->body = (string) $body; return $this;