This commit is contained in:
as2252258@163.com
2021-09-21 02:50:38 +08:00
parent 1825a677b8
commit 3e10de58ed
+9 -3
View File
@@ -29,11 +29,17 @@ class Response implements ResponseInterface
const FILE = 'file';
/**
* @throws \Kiri\Exception\ConfigException
*/
public function __construct()
{
$contentType = Config::get('response.format',ContentType::JSON);
$this->withContentType($contentType)->withCharset('utf-8');
$contentType = Config::get('response',[
'format' => ContentType::JSON,
'charset' => 'utf-8'
]);
$this->withContentType($contentType['format'])
->withCharset($contentType['charset']);
}