mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 23:09:10 +08:00
Fixes #833: added charset to json response.
This commit is contained in:
@@ -781,7 +781,7 @@ class Response extends \yii\base\Response
|
||||
$this->content = $this->data;
|
||||
break;
|
||||
case self::FORMAT_JSON:
|
||||
$this->getHeaders()->set('Content-Type', 'application/json');
|
||||
$this->getHeaders()->set('Content-Type', 'application/json; charset=' . $this->charset);
|
||||
$this->content = Json::encode($this->data);
|
||||
break;
|
||||
case self::FORMAT_JSONP:
|
||||
|
||||
Reference in New Issue
Block a user