From b959630e6ab56a25ebc9b49e699e2edb38969ec5 Mon Sep 17 00:00:00 2001 From: twosee Date: Fri, 28 Oct 2022 11:41:07 +0800 Subject: [PATCH] Unified shouldKeepAlive() --- http_server/mixed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } }