diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-10-18 03:30:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-18 03:30:21 +0200 |
commit | 154a9989a7a78c02ce8811f03e6879240ad9e57c (patch) | |
tree | 99e7bd1f8191d251ebd7da866a4c14dbb7502b91 /lib | |
parent | e1d33096d387314b20313204a17389225b44d957 (diff) | |
parent | 066f6ef16c7adb365b8c260ea6f06906ab63724e (diff) | |
download | nextcloud-server-154a9989a7a78c02ce8811f03e6879240ad9e57c.tar.gz nextcloud-server-154a9989a7a78c02ce8811f03e6879240ad9e57c.zip |
Merge pull request #39852 from nextcloud/pragmaHeader
Stop sending deprecated Pragma header
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/legacy/OC_Files.php | 1 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/Response.php | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index 911c713f840..ac0a2bbd0e9 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -76,7 +76,6 @@ class OC_Files { private static function sendHeaders($filename, $name, array $rangeArray): void { OC_Response::setContentDispositionHeader($name, 'attachment'); header('Content-Transfer-Encoding: binary', true); - header('Pragma: public');// enable caching in IE header('Expires: 0'); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); $fileSize = \OC\Files\Filesystem::filesize($filename); diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index dd4f2c53418..d28f45f4c60 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -112,9 +112,8 @@ class Response { */ public function cacheFor(int $cacheSeconds, bool $public = false, bool $immutable = false) { if ($cacheSeconds > 0) { - $pragma = $public ? 'public' : 'private'; - $this->addHeader('Cache-Control', sprintf('%s, max-age=%s, %s', $pragma, $cacheSeconds, ($immutable ? 'immutable' : 'must-revalidate'))); - $this->addHeader('Pragma', $pragma); + $cacheStore = $public ? 'public' : 'private'; + $this->addHeader('Cache-Control', sprintf('%s, max-age=%s, %s', $cacheStore, $cacheSeconds, ($immutable ? 'immutable' : 'must-revalidate'))); // Set expires header $expires = new \DateTime(); @@ -125,7 +124,7 @@ class Response { $this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC2822)); } else { $this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); - unset($this->headers['Expires'], $this->headers['Pragma']); + unset($this->headers['Expires']); } return $this; |