aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2023-08-13 23:07:38 +0200
committerAnna <anna@nextcloud.com>2023-08-28 15:11:22 +0200
commit066f6ef16c7adb365b8c260ea6f06906ab63724e (patch)
tree65ed7c3ebdd1d63f7aad47326cf1689475176753 /lib
parentc2d55ab5f6284313a999c4d71224c0401f04edd4 (diff)
downloadnextcloud-server-066f6ef16c7adb365b8c260ea6f06906ab63724e.tar.gz
nextcloud-server-066f6ef16c7adb365b8c260ea6f06906ab63724e.zip
Stop sending deprecated Pragma header
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/legacy/OC_Files.php1
-rw-r--r--lib/public/AppFramework/Http/Response.php7
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php
index 7bc1fab94b6..ecca6d3819f 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;