Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Not sending a content-length for redirection status codes that are no…
…t supposed to have any content
  • Loading branch information
lorenzo committed Oct 28, 2011
1 parent aabfad9 commit 29ca42e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Network/CakeResponse.php
Expand Up @@ -351,8 +351,8 @@ public function send() {
$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) {
Expand Down

0 comments on commit 29ca42e

Please sign in to comment.