mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #3872 from CostaC/response-sharable-fix
Fix for CakeResponse::sharable() header to include private caches
This commit is contained in:
commit
1eccec02e4
2 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue