diff --git a/src/HttpApi/Controllers/Controller.php b/src/HttpApi/Controllers/Controller.php index 92315c2..6d2c79a 100644 --- a/src/HttpApi/Controllers/Controller.php +++ b/src/HttpApi/Controllers/Controller.php @@ -52,7 +52,7 @@ abstract class Controller implements HttpServerInterface { return Collection::make($headers)->first(function ($values, $header) { return strtolower($header) === 'content-length'; - }); + })[0] ?? 0; } public function onMessage(ConnectionInterface $from, $msg)