mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Send charset in Content-Type when Content is JSON.
This commit is contained in:
parent
4ebe754076
commit
ac0b9b285d
1 changed files with 1 additions and 1 deletions
|
@ -409,7 +409,7 @@ class CakeResponse {
|
|||
if (in_array($this->_status, array(304, 204))) {
|
||||
return;
|
||||
}
|
||||
if (strpos($this->_contentType, 'text/') === 0) {
|
||||
if (strpos($this->_contentType, 'text/') === 0 || $this->_contentType === 'application/json') {
|
||||
$this->header('Content-Type', "{$this->_contentType}; charset={$this->_charset}");
|
||||
} else {
|
||||
$this->header('Content-Type', "{$this->_contentType}");
|
||||
|
|
Loading…
Add table
Reference in a new issue