Project

General

Profile

Actions

Bug #99534

closed

Content-Type forced to text/html when streaming file

Added by Gregor Hermens over 1 year ago. Updated 2 months ago.

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

bug99534_0.0.2_202301141542.zip (10.5 KB) bug99534_0.0.2_202301141542.zip Gregor Hermens, 2023-01-14 15:50

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #100189: Content-Type charset is now also added for application/binary Extbase responsesResolvedBenni Mack2023-03-16

Actions
Actions

Also available in: Atom PDF