From: Tim Düsterhus Date: Wed, 11 Aug 2021 11:32:06 +0000 (+0200) Subject: Clean up the `cache-control` processing in RequestHandler::sendPsr7Response() X-Git-Tag: 5.5.0_Alpha_1~493^2~2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=91f460acc19c9cb859416d62ea3d1cbb2581832c;p=GitHub%2FWoltLab%2FWCF.git Clean up the `cache-control` processing in RequestHandler::sendPsr7Response() --- diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 2b97fac1f6..61c1069c0c 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -158,7 +158,9 @@ class RequestHandler extends SingletonFactory { // Storing responses in a shared cache is unsafe, because they all contain session specific information. // Add the 'private' value to the cache-control header and remove any 'public' value. - $cacheControl = []; + $cacheControl = [ + 'private', + ]; foreach ($this->splitCacheControl($response->getHeader('cache-control')) as $value) { [$field] = \explode('=', $value, 2); @@ -174,7 +176,6 @@ class RequestHandler extends SingletonFactory $cacheControl[] = $value; } - $cacheControl[] = 'private'; $response = $response->withHeader( 'cache-control',