Actions
Bug #99534
closedContent-Type forced to text/html when streaming file
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-01-13
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint
Description
I have an extbase action that streams a file like
/** @var \TYPO3\CMS\Core\Resource\FileReference $file */
$originalFile = $file->getOriginalResource()->getOriginalFile();
return $originalFile->getStorage()->streamFile(
$originalFile,
false
);
The target page is stripped down to the minimum:
config > config { disableAllHeaderCode = 1 disableBodyTag = 1 disableCharsetHeader = 1 disableLanguageHeader = 1 doctype = none admPanel = 0 debug = 0 xhtml_cleaning = none disablePrefixComment = 1 no_cache = 1 } page > page = PAGE page { 10 = COA_INT 10 { 10 < tt_content.list.20.myext_downloadstream } }
This has worked up to TYPO3 11.5.21.
With TYPO3 11.5.22 the Content-Type header is forced to text/html.
I suspect #99373 to cause this, but can't find the exact reason.
The correct Content-Type is set if I comment line 185 of
TYPO3\CMS\Extbase\Core\Bootstrap->handleFrontendRequest(): $response = $response->withoutHeader('Content-Type');
Files
Actions