From 9e829c1607b72efd75f2f942631c8a48c324ee7f Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Thu, 5 Jul 2018 22:50:35 +0100 Subject: [PATCH] FIX Allow cache control changes to affect default state --- src/Control/Middleware/HTTPCacheControlMiddleware.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Control/Middleware/HTTPCacheControlMiddleware.php b/src/Control/Middleware/HTTPCacheControlMiddleware.php index 572e6fb2b..18801f204 100644 --- a/src/Control/Middleware/HTTPCacheControlMiddleware.php +++ b/src/Control/Middleware/HTTPCacheControlMiddleware.php @@ -513,7 +513,7 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable public function setMaxAge($age) { // Affect all non-disabled states - $applyTo = [self::STATE_ENABLED, self::STATE_PRIVATE, self::STATE_PUBLIC]; + $applyTo = [self::STATE_ENABLED, self::STATE_PRIVATE, self::STATE_PUBLIC, self::STATE_DEFAULT]; $this->setStateDirective($applyTo, 'max-age', $age); return $this; } @@ -529,7 +529,7 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable public function setSharedMaxAge($age) { // Affect all non-disabled states - $applyTo = [self::STATE_ENABLED, self::STATE_PRIVATE, self::STATE_PUBLIC]; + $applyTo = [self::STATE_ENABLED, self::STATE_PRIVATE, self::STATE_PUBLIC, self::STATE_DEFAULT]; $this->setStateDirective($applyTo, 's-maxage', $age); return $this; } @@ -543,7 +543,7 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable */ public function setMustRevalidate($mustRevalidate = true) { - $applyTo = [self::STATE_ENABLED, self::STATE_PRIVATE, self::STATE_PUBLIC]; + $applyTo = [self::STATE_ENABLED, self::STATE_PRIVATE, self::STATE_PUBLIC, self::STATE_DEFAULT]; $this->setStateDirective($applyTo, 'must-revalidate', $mustRevalidate); return $this; }