From 91f460acc19c9cb859416d62ea3d1cbb2581832c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 11 Aug 2021 13:32:06 +0200 Subject: [PATCH] Clean up the `cache-control` processing in RequestHandler::sendPsr7Response() --- .../files/lib/system/request/RequestHandler.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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', -- 2.20.1