mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-17 06:59:51 +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))) {
|
if (in_array($this->_status, array(304, 204))) {
|
||||||
return;
|
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}");
|
$this->header('Content-Type', "{$this->_contentType}; charset={$this->_charset}");
|
||||||
} else {
|
} else {
|
||||||
$this->header('Content-Type', "{$this->_contentType}");
|
$this->header('Content-Type', "{$this->_contentType}");
|
||||||
|
|
Loading…
Add table
Reference in a new issue