diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-01-10 14:07:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-10 14:07:13 +0100 |
commit | aee11009bd8c594adb16fb40f890b231d0ecc2ad (patch) | |
tree | 99f01ac763c5c9e8768486036f35db9301d5f884 | |
parent | 4dd2a1e6798b9915e20ac72272fbe1bab0266e93 (diff) | |
parent | 45c6301772721258c765f76a342958c190e9598e (diff) | |
download | nextcloud-server-aee11009bd8c594adb16fb40f890b231d0ecc2ad.tar.gz nextcloud-server-aee11009bd8c594adb16fb40f890b231d0ecc2ad.zip |
Merge pull request #3000 from nextcloud/cache-no-store
set 'no-store' cache header if we do not want FF to cache
-rw-r--r-- | lib/public/AppFramework/Http/Response.php | 4 | ||||
-rw-r--r-- | tests/lib/AppFramework/Controller/ControllerTest.php | 2 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/DataResponseTest.php | 2 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/ResponseTest.php | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index 8591d6abc68..051e68f3144 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -43,11 +43,11 @@ use OCP\AppFramework\Http; class Response { /** - * Headers - defaults to ['Cache-Control' => 'no-cache, must-revalidate'] + * Headers - defaults to ['Cache-Control' => 'no-cache, no-store, must-revalidate'] * @var array */ private $headers = array( - 'Cache-Control' => 'no-cache, must-revalidate' + 'Cache-Control' => 'no-cache, no-store, must-revalidate' ); diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php index 63cc2873575..640853ccda9 100644 --- a/tests/lib/AppFramework/Controller/ControllerTest.php +++ b/tests/lib/AppFramework/Controller/ControllerTest.php @@ -182,7 +182,7 @@ class ControllerTest extends \Test\TestCase { public function testFormatDataResponseJSON() { $expectedHeaders = [ 'test' => 'something', - 'Cache-Control' => 'no-cache, must-revalidate', + 'Cache-Control' => 'no-cache, no-store, must-revalidate', 'Content-Type' => 'application/json; charset=utf-8', 'Content-Security-Policy' => "default-src 'none';script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self'", ]; diff --git a/tests/lib/AppFramework/Http/DataResponseTest.php b/tests/lib/AppFramework/Http/DataResponseTest.php index cde553cdf5f..159efded97a 100644 --- a/tests/lib/AppFramework/Http/DataResponseTest.php +++ b/tests/lib/AppFramework/Http/DataResponseTest.php @@ -67,7 +67,7 @@ class DataResponseTest extends \Test\TestCase { $response = new DataResponse($data, $code, $headers); $expectedHeaders = [ - 'Cache-Control' => 'no-cache, must-revalidate', + 'Cache-Control' => 'no-cache, no-store, must-revalidate', 'Content-Security-Policy' => "default-src 'none';script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self'", ]; $expectedHeaders = array_merge($expectedHeaders, $headers); diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php index 0c582f8f6ea..3ed946dc6ca 100644 --- a/tests/lib/AppFramework/Http/ResponseTest.php +++ b/tests/lib/AppFramework/Http/ResponseTest.php @@ -97,7 +97,7 @@ class ResponseTest extends \Test\TestCase { public function testCacheHeadersAreDisabledByDefault(){ $headers = $this->childResponse->getHeaders(); - $this->assertEquals('no-cache, must-revalidate', $headers['Cache-Control']); + $this->assertEquals('no-cache, no-store, must-revalidate', $headers['Cache-Control']); } |