FIX Allow cache control changes to affect default state

This commit is contained in:
Daniel Hensby 2018-07-05 22:50:35 +01:00
parent d46410c49b
commit 997730aa7f
No known key found for this signature in database
GPG Key ID: D8DEBC4C8E7BC8B9

View File

@ -513,7 +513,7 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable
public function setMaxAge($age) public function setMaxAge($age)
{ {
// Affect all non-disabled states // 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); $this->setStateDirective($applyTo, 'max-age', $age);
return $this; return $this;
} }
@ -529,7 +529,7 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable
public function setSharedMaxAge($age) public function setSharedMaxAge($age)
{ {
// Affect all non-disabled states // 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); $this->setStateDirective($applyTo, 's-maxage', $age);
return $this; return $this;
} }
@ -543,7 +543,7 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable
*/ */
public function setMustRevalidate($mustRevalidate = true) 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); $this->setStateDirective($applyTo, 'must-revalidate', $mustRevalidate);
return $this; return $this;
} }