Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Adapt cacheFor to server changes
Instead of using the same name for the PicoAssetResponse cacheFor method
as the OCP Response class, use a custom name..

Signed-off-by: Carl Schwan <[email protected]>
  • Loading branch information
CarlSchwan committed Mar 16, 2022
commit 98562c15f86169aa4180ee395d704914fd955328
6 changes: 3 additions & 3 deletions lib/Http/PicoAssetResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public function __construct(PicoAsset $asset, bool $enableCache = true, bool $en
$this->setLastModified($asset->getLastModified());

if ($enableCache && isset($this->cacheFor[$mimeType])) {
$this->cacheFor($this->cacheFor[$mimeType], $asset->isPublicAsset());
$this->picoCacheFor($this->cacheFor[$mimeType], $asset->isPublicAsset());
} else {
$this->cacheFor(0);
$this->picoCacheFor(0);
}
}

Expand All @@ -102,7 +102,7 @@ public function setContentSecurityPolicy(EmptyContentSecurityPolicy $csp): self
*
* @return $this
*/
public function cacheFor(int $cacheSeconds, bool $public = false, bool $immutable = false): self
private function picoCacheFor(int $cacheSeconds, bool $public = false, bool $immutable = false): self
{
if ($cacheSeconds > 0) {
$pragma = $public ? 'public' : 'private';
Expand Down