says, it is enough to return a response with a defined content-type header (text/xml). But this is wrong. In page renderer it is overwritten with text/html. As this comes from EXT:blog_example, this is not as easy to adjust. Perhaps it is correctly set in the blog example as in TypoScript the header is set additionally. But this is only the case because the example is defined with a page type.
The solution is to throw a PropagateResponseException($response, 200);. This is also the way to go with downloads, like:
The example on page:
https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/Extbase/Reference/View/Index.html#response-in-a-different-format
says, it is enough to return a response with a defined content-type header (
text/xml
). But this is wrong. In page renderer it is overwritten withtext/html
. As this comes from EXT:blog_example, this is not as easy to adjust. Perhaps it is correctly set in the blog example as in TypoScript the header is set additionally. But this is only the case because the example is defined with a page type.The solution is to throw a
PropagateResponseException($response, 200);
. This is also the way to go with downloads, like: