From 1164c0bcadc80122a462c1cd9a43207d5c662b47 Mon Sep 17 00:00:00 2001 From: Costa Caruso Date: Wed, 2 Jul 2014 17:34:09 -0400 Subject: [PATCH 1/3] Fix for CakeResponse::sharable() header to include private caches --- lib/Cake/Network/CakeResponse.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index d2019465e..21a69c0e2 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -834,12 +834,11 @@ 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(); } From 4f559f5cc954438662bf9a8f030f3ec19dc23a3a Mon Sep 17 00:00:00 2001 From: Costa Caruso Date: Thu, 3 Jul 2014 15:03:48 -0400 Subject: [PATCH 2/3] Fixed failing test for CakeResponse::sharable + spacing --- lib/Cake/Network/CakeResponse.php | 1 + lib/Cake/Test/Case/Network/CakeResponseTest.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 21a69c0e2..47d0e2e3c 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -838,6 +838,7 @@ class CakeResponse { $this->_cacheDirectives['private'] = true; unset($this->_cacheDirectives['public']); } + $this->maxAge($time); if (!$time) { $this->_setCacheControl(); diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index 59504de14..cb6ee2d73 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -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); From 8bfebd64fb36d1ac889c27fcb7930134c4483022 Mon Sep 17 00:00:00 2001 From: Costa Caruso Date: Thu, 3 Jul 2014 15:45:03 -0400 Subject: [PATCH 3/3] Fix for failing test "Whitespace found at end of line" --- 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 47d0e2e3c..ead5b77ca 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -838,7 +838,7 @@ class CakeResponse { $this->_cacheDirectives['private'] = true; unset($this->_cacheDirectives['public']); } - + $this->maxAge($time); if (!$time) { $this->_setCacheControl();