From c660543bb798f07c21dee4627ecf6c366c6cbb2c Mon Sep 17 00:00:00 2001 From: Marek Szymczuk Date: Sun, 4 Aug 2024 17:52:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20bad=20method=20call=20exce?= =?UTF-8?q?ption=20in=20the=20`Server`=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/Server.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Http/Server.php b/src/Http/Server.php index d45c5db..d451493 100644 --- a/src/Http/Server.php +++ b/src/Http/Server.php @@ -13,6 +13,7 @@ use React\Http\HttpServer; use React\Http\Message\Response; use React\Socket\SocketServer; +use Symfony\Component\HttpFoundation\BinaryFileResponse; use Throwable; class Server @@ -141,7 +142,7 @@ public function getServer() return new Response( $response->getStatusCode(), $response->headers->allPreserveCase(), - $response->getContent() ?: $response->getFile()?->getContent() ?: '' + $response->getContent() ?: ($response instanceof BinaryFileResponse ? $response->getFile()->getContent() : false) ?: '' ); }); }