This commit is contained in:
2021-07-27 18:37:08 +08:00
parent 0510c1af41
commit a4160b78f2
+6 -1
View File
@@ -4,6 +4,7 @@ defined('APP_PATH') or define('APP_PATH', realpath(__DIR__ . '/../../'));
use Annotation\Annotation;
use HttpServer\Http\Context;
use HttpServer\Http\HttpParams;
use HttpServer\Http\Request;
use HttpServer\Http\Response;
@@ -613,7 +614,11 @@ if (!function_exists('response')) {
*/
function response(): Response|stdClass
{
return Snowflake::getApp('response');
$response = Context::getContext('response');
if (empty($response)){
$response = Snowflake::getApp('response');
}
return $response;
}
}