77158[BUGFIX] Send correct content type for cached Extbase actions
Commit message
Review
-
Code review CR +2 Done
- Helmut Hummel +2
- Daniel Goerz +1
- Markus Klein +1
- Guido Schmechel +1
- Benni Mack +1
-
Verified V +2 Done
- Helmut Hummel +2
- Markus Klein +1
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 4
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Classes/Controller/QueueController.php+1 −4
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_foreignfield/Classes/Controller/QueueController.php+1 −4
- typo3/sysext/extbase/Classes/Core/Bootstrap.php5+3 −2
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php+4 −1
Review log 2629
Show 34 earlier messages
-
Helmut Hummel uploaded patch set 1 12/14/22, 17:59
-
Helmut Hummel marked it work in progress 12/14/22, 18:00
-
core-ci voted on patch set 1 V -1 12/14/22, 18:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35117
-
Benni Mack commented on patch set 1 12/14/22, 18:25
Can you elaborate why you added the config. TS option? because AFAICS you did this to keep this in scenarios with USER + USER_INTs?
-
Markus Klein commented on patch set 1 12/14/22, 19:40
Please definitely add more comments on this config thingy.Reply
Please add your thoughts as comments to the code. This will be extremely valuable in some years. -
Sascha Egerer commented on patch set 1 12/15/22, 10:24
Bootstrap.php:169IMO the server should decide if it can answer with the requested Content-Type. With this implementation it feels a bit unsafe as one can inject any value into the response content-type header. This may introduce a security issue if other internals change. -
Helmut Hummel commented on patch set 1 12/15/22, 10:32
Reply
uh, yeah, sorry. I can explain my thoughts, and maybe it is indeed valuable to write them down as code comments and not only in the ticket or here. -
Helmut Hummel commented on patch set 1 12/15/22, 10:41
Bootstrap.php:169ReplyContext here is, that the code reads the response from an Extbase Plugin and does something with it. Current State: Any Extbase Plugin can set any content-type and TYPO3 will happily send it. It will send it on first request for cached actions and on all subsequent requests for uncached actions. For cached actions this code is never executed, thus content-type will always be text/html when the page comes from cache. Plugins that are rendered later, will override headers of plugins that are rendered earlier. My change does not change much on this state, except that the behaviour of cached actions and uncached actions is aligned and thus allows cached pages with a different content type. If there is a security issue with this code (which I don't see right now), it would be good to fix anyway 😊 -
Sascha Egerer commented on patch set 1 12/15/22, 10:42
Sorry... did not read carefully. Forgot about my commentBootstrap.php:169ReplyOh sorry, nevermind. I assumed that a header is read from the request, because I only read the getHeader. 🫣 -
Benni Mack commented on patch set 1 12/15/22, 10:46
Bootstrap.php:169ReplyOK. For this reason, if you're OK with it, I'd like to put this not in $this->config['config']['contentType'] but in $this->config['contentType'] - or just decide if we add the contentType to the caching information (which is easy to do, I can do that if you like, I had some hurdles with that with asset collector back then) -
Benni Mack commented on patch set 1 12/15/22, 10:46
And of course, I agree with the approach in general (Extbase can send more than just JSON) :) -
Helmut Hummel uploaded patch set 2
V -112/15/22, 17:03 -
Helmut Hummel commented on patch set 2 12/15/22, 17:03
Bootstrap.php:169ReplyYes, the config stuff is just a hack to get the value into the cache. I can take care. -
Helmut Hummel commented on patch set 2 12/15/22, 17:04
This change is ready for review.Reply
Changed that like Benni also suggested. -
core-ci voted on patch set 2 V -1 12/15/22, 17:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35175
-
Benni Mack commented on patch set 2 12/20/22, 16:55
Perfect change for me (once CI is green) -
Helmut Hummel uploaded patch set 3
V -112/20/22, 21:31 -
Helmut Hummel commented on patch set 2 12/20/22, 21:31
Reply
Thanks! Fingers crossed ;) -
core-ci voted on patch set 3 V +1 12/20/22, 21:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35249
-
Benni Mack voted on patch set 3 CR +1 12/20/22, 22:18
-
Markus Klein voted on patch set 3 CR +1 12/21/22, 11:57
-
Daniel Goerz voted on patch set 3 CR +1 12/22/22, 10:45
-
Guido Schmechel voted on patch set 3 CR +1 12/28/22, 15:31
-
Benni Mack voted on patch set 3 V +1 12/28/22, 22:55
-
Markus Klein voted on patch set 3 V +1 01/04/23, 10:50
-
Helmut Hummel voted on patch set 3 V +2 CR +2 01/04/23, 13:53
-
Helmut Hummel commented on patch set 3 01/04/23, 13:54
Thanks a lot for your feedback and reviews! -
Helmut Hummel merged patch set 4 01/04/23, 13:54
-
Benni Mack commented on patch set 4 03/16/23, 22:29
This change introduced a regression, see here for the fix: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78132