Permalink
Browse files

Send charset in Content-Type when Content is JSON.

  • Loading branch information...
1 parent 4ebe754 commit ac0b9b285d33b1ebc86567894d813443c00f5f0c @frederikweber frederikweber committed Nov 18, 2012
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}");

0 comments on commit ac0b9b2

Please sign in to comment.