Use Header::splitList() instead of Header::normalize()
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 10 Jun 2022 09:52:44 +0000 (11:52 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 10 Jun 2022 09:52:44 +0000 (11:52 +0200)
see guzzle/psr7#477

wcfsetup/install/files/lib/http/middleware/EnforceCacheControlPrivate.class.php
wcfsetup/install/files/lib/util/ImageUtil.class.php

index 217d1d0fb848a516fc59f3e98dfb5707bfc2e25b..e8aa9d688eabb0d016eb7fa6a3a00c080e060ea0 100644 (file)
@@ -36,7 +36,7 @@ final class EnforceCacheControlPrivate implements MiddlewareInterface
         $cacheControl = [
             'private',
         ];
-        foreach (Header::normalize($response->getHeader('cache-control')) as $value) {
+        foreach (Header::splitList($response->getHeader('cache-control')) as $value) {
             [$field] = \explode('=', $value, 2);
 
             // Prevent duplication of the 'private' field.
index b5095de55b5a2632816e40de9fc3625cf6d7b8f2..0ea38dec4980f72533fe99156e879de865a79620 100644 (file)
@@ -216,7 +216,7 @@ final class ImageUtil
                     [$mimeType] = ArrayUtil::trim(\explode(";", $acceptableMimeType), false);
 
                     return $mimeType;
-                }, Header::normalize($_SERVER["HTTP_ACCEPT"]));
+                }, Header::splitList($_SERVER["HTTP_ACCEPT"]));
 
                 if (\in_array("image/webp", $acceptableMimeTypes)) {
                     $supportsWebP = true;