Browse Source

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

Fix for CakeResponse::sharable() header to include private caches
ADmad 11 years ago
parent
commit
1eccec02e4

+ 2 - 2
lib/Cake/Network/CakeResponse.php

@@ -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();
 		}

+ 1 - 1
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);