From 29ca42ed7ae5d0a1dcb257a93fb11b3a8a7c3b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Thu, 27 Oct 2011 22:44:42 -0530 Subject: [PATCH] Not sending a content-length for redirection status codes that are not supposed to have any content --- lib/Cake/Network/CakeResponse.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index e65b8899c..41cb0f412 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -351,8 +351,8 @@ class CakeResponse { $this->_sendHeader("{$this->_protocol} {$this->_status} {$codeMessage}"); $this->_sendHeader('Content-Type', "{$this->_contentType}; charset={$this->_charset}"); $shouldSetLength = empty($this->_headers['Content-Length']) && class_exists('Multibyte'); - $shouldSetLength = $shouldSetLength && !$this->outputCompressed(); - if ($shouldSetLength) { + $shouldSetLength = $shouldSetLength && !in_array($this->_status, range(301, 307)); + if ($shouldSetLength && !$this->outputCompressed()) { $this->_headers['Content-Length'] = mb_strlen($this->_body); } foreach ($this->_headers as $header => $value) {