Skip to content

Commit

Permalink
Merge pull request #3872 from CostaC/response-sharable-fix
Browse files Browse the repository at this point in the history
Fix for CakeResponse::sharable() header to include private caches
  • Loading branch information
ADmad committed Jul 4, 2014
2 parents 765be87 + 8bfebd6 commit 1eccec0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Network/CakeResponse.php
Expand Up @@ -834,12 +834,12 @@ public function sharable($public = null, $time = null) {
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();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Network/CakeResponseTest.php
Expand Up @@ -751,7 +751,7 @@ public function testSharable() {
$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);
Expand Down

0 comments on commit 1eccec0

Please sign in to comment.