From a7695a2dbdfdd4c39ea1533553e3dc257af1f0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 4 Aug 2021 17:17:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/function.php b/function.php index 0eee08ec..dada6e38 100644 --- a/function.php +++ b/function.php @@ -20,6 +20,7 @@ use Snowflake\Exception\NotFindClassException; use Snowflake\Snowflake; use Swoole\WebSocket\Server; use Server\Constrict\Response; +use HttpServer\Http\Response as HttpResponse; if (!function_exists('make')) { @@ -599,10 +600,10 @@ if (!function_exists('response')) { */ function response(): Response { - if (!Context::hasContext(Response::class)){ - return Context::setContext(Response::class, new Response()); + if (!Context::hasContext(HttpResponse::class)){ + Context::setContext(HttpResponse::class, new HttpResponse()); } - return Context::getContext(Response::class); + return di(Response::class); } }