From ac0b9b285d33b1ebc86567894d813443c00f5f0c Mon Sep 17 00:00:00 2001 From: frederikweber <weber.frederik@gibm.educanet2.ch> Date: Sun, 18 Nov 2012 11:39:17 +0100 Subject: [PATCH] Send charset in Content-Type when Content is JSON. --- lib/Cake/Network/CakeResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 79be981ac..e3cb8a921 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -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}");