Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Send charset in Content-Type when Content is JSON.

  • Loading branch information...
commit ac0b9b285d33b1ebc86567894d813443c00f5f0c 1 parent 4ebe754
@frederikweber frederikweber authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Cake/Network/CakeResponse.php
View
2  lib/Cake/Network/CakeResponse.php
@@ -409,7 +409,7 @@ protected function _setContentType() {
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}");
Please sign in to comment.
Something went wrong with that request. Please try again.