Skip to content

Commit

Permalink
🩹 Fix bad method call exception in the Server class
Browse files Browse the repository at this point in the history
  • Loading branch information
bonzai authored Aug 4, 2024
1 parent 152a1f8 commit c660543
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Http/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) ?: ''
);
});
}
Expand Down

0 comments on commit c660543

Please sign in to comment.