Merge pull request #3872 from CostaC/response-sharable-fix

Fix for CakeResponse::sharable() header to include private caches
This commit is contained in:
ADmad 2014-07-04 10:32:51 +05:30
commit 1eccec02e4
2 changed files with 3 additions and 3 deletions

View file

@ -834,12 +834,12 @@ class CakeResponse {
if ($public) {
$this->_cacheDirectives['public'] = true;
unset($this->_cacheDirectives['private']);
$this->sharedMaxAge($time);
} else {
$this->_cacheDirectives['private'] = true;
unset($this->_cacheDirectives['public']);
$this->maxAge($time);
}
$this->maxAge($time);
if (!$time) {
$this->_setCacheControl();
}

View file

@ -751,7 +751,7 @@ class CakeResponseTest extends CakeTestCase {
$response = new CakeResponse;
$response->sharable(true, 3600);
$headers = $response->header();
$this->assertEquals('public, s-maxage=3600', $headers['Cache-Control']);
$this->assertEquals('public, max-age=3600', $headers['Cache-Control']);
$response = new CakeResponse;
$response->sharable(false, 3600);