Skip to content

Commit c20565f

Browse files
saschanowaksbuerk
authored andcommitted
[BUGFIX] Properly set multi cache tag headers on Windows
This patch prevents to rely on the wordwrap default break parameter and explicitly uses the same linebreak ("\n") values for explode and wordwrap. This allows to properly send out the HTTP cache tag headers split into multiple distinct values, so no wrong CR/LF header values are sent. Resolves: #106898 Releases: main, 13.4 Change-Id: I9ea22acfc6c12ab75bb42652e9c93d123beaa364 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/89947 Tested-by: core-ci <typo3@b13.com> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Stefan Bürk <stefan@buerk.tech>
1 parent 6ffc905 commit c20565f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

typo3/sysext/core/Classes/Middleware/CacheDataCollectorAttribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
6262
if ($this->isDebugModeEnabled()) {
6363
$cacheTags = array_map(fn(CacheTag $cacheTag) => $cacheTag->name, $this->cacheDataCollector->getCacheTags());
6464
sort($cacheTags);
65-
foreach (explode(PHP_EOL, wordwrap(implode(' ', $cacheTags), self::MAX_CACHE_TAGS_HEADER_LENGTH)) as $delta => $tags) {
65+
foreach (explode("\n", wordwrap(implode(' ', $cacheTags), self::MAX_CACHE_TAGS_HEADER_LENGTH, "\n")) as $delta => $tags) {
6666
$response = $response->withHeader('X-TYPO3-Cache-Tags' . ($delta > 0 ? '-' . $delta : ''), $tags);
6767
}
6868
$response = $response->withHeader('X-TYPO3-Cache-Lifetime', (string)$this->cacheDataCollector->resolveLifetime());

0 commit comments

Comments
 (0)