From 5366629e264e2db3e0626af5bc1fd34a9791ba38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 4 Aug 2021 15:32:15 +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 --- HttpServer/Http/Response.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/HttpServer/Http/Response.php b/HttpServer/Http/Response.php index e7435c6c..87a040fe 100644 --- a/HttpServer/Http/Response.php +++ b/HttpServer/Http/Response.php @@ -213,10 +213,11 @@ class Response extends HttpService if (empty($this->endData) || is_string($this->endData)) { return $this->endData; } - - $class = Response::FORMAT_MAPS[$this->format] ?? HtmlFormatter::class; - - return \di($class)->send($this->endData)->getData(); + if (!($this->endData instanceof Response)) { + $class = Response::FORMAT_MAPS[$this->format] ?? HtmlFormatter::class; + return \di($class)->send($this->endData)->getData(); + } + return $this->endData->getContent(); }