diff --git a/http_server/mixed.php b/http_server/mixed.php index 43f3619..99f0131 100644 --- a/http_server/mixed.php +++ b/http_server/mixed.php @@ -106,10 +106,10 @@ $connection->error(HttpStatus::NOT_FOUND); } } catch (HttpProtocolException $exception) { - $connection->error($exception->getCode(), $exception->getMessage()); + $connection->error($exception->getCode(), $exception->getMessage(), close: true); break; } - if (!$request || !Psr7::detectShouldKeepAlive($request)) { + if (!$connection->shouldKeepAlive()) { break; } }