]> source.dussan.org Git - nextcloud-server.git/commitdiff
Proxy server could cache http response when it is not private
authorClement Wong <git@clement.hk>
Sun, 10 May 2020 09:06:56 +0000 (11:06 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 15 May 2020 06:24:07 +0000 (06:24 +0000)
Signed-off-by: Clement Wong <git@clement.hk>
lib/public/AppFramework/Http/Response.php

index f46aa9e2880fd45c72ab47a444315f47add22692..186190956948e59c27aa403fcb0cf3abdc67fce4 100644 (file)
@@ -106,11 +106,11 @@ class Response {
         * @since 6.0.0 - return value was added in 7.0.0
         */
        public function cacheFor(int $cacheSeconds) {
-               if($cacheSeconds > 0) {
-                       $this->addHeader('Cache-Control', 'max-age=' . $cacheSeconds . ', must-revalidate');
+               if ($cacheSeconds > 0) {
+                       $this->addHeader('Cache-Control', 'private, max-age=' . $cacheSeconds . ', must-revalidate');
 
                        // Old scool prama caching
-                       $this->addHeader('Pragma', 'public');
+                       $this->addHeader('Pragma', 'private');
 
                        // Set expires header
                        $expires = new \DateTime();