[TASK] Stop JsonView from setting headers 78/66078/5
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Thu, 8 Oct 2020 05:28:47 +0000 (07:28 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 28 Oct 2020 23:00:31 +0000 (00:00 +0100)
commit78ad2e857bb51aee8c2fbe1f2e8c10313870c53f
tree487159f3047f46a1a8f52623e21f4c18056836ea
parent5a8a4d355a20de3d11e74c757a597dd09b75dcb4
[TASK] Stop JsonView from setting headers

JsonView did set content type headers in its render method which
is a problem since the view should only be responsible for rendering
the content of the to be returned response.

The current approach, setting those headers in the action controller,
is just a temporary solution until Extbase is capable of handling
PSR-7 responses which then makes it superfluous to set headers
magically. Instead people will need to set headers manually or use
a JsonResponse object instead and let the core handle setting headers
further down in the request/response handling stack.

Releases: master
Resolves: #92692
Change-Id: Idfa417cfd25d7f692dea2e6d6822f1d3a44cb38d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66078
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack <benni@typo3.org>
typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
typo3/sysext/extbase/Classes/Mvc/View/JsonView.php
typo3/sysext/extbase/Tests/Unit/Mvc/View/JsonViewTest.php