You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
brotkrueml
changed the title
Extbase: Example with response in different format does not work
Extbase: Example with response in different content type does not work
Dec 3, 2022
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:The text was updated successfully, but these errors were encountered: