[BUGFIX] Catch ImmediateResponseException in Application->handle()
When TYPO3 is 'natively' called by a web server call, the main application entry point is AbstractApplication run(). When using a PSR-15 from within some other application, a request should be hand over to Application->handle(), expecting a response object. Now we have that ImmediateResponseException thrown by TYPO3 at some places. ImmediateResponseException is only caught within run(), not within handle(). A PSR-15 call to handle() will thus not catch ImmediateResponseException, it bubbles up to the calling application. PSR-15 section 1.4 of https://www.php-fig.org/psr/psr-15/: "It is RECOMMENDED that any application using middleware includes a component that catches exceptions and converts them into responses." The patch changes AbstractApplication to follow this: The ImmediateResponseException is a TYPO3 internal management exception, a calling application should never need to deal with it, but can expect to receive a response object instead. Change-Id: I2857efd2b575a9b324d3d7a23df0bca5763a8839 Resolves: #96099 Releases: master, 11.5 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72321 Reviewed-by:Benni Mack <benni@typo3.org> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch>
Please register or sign in to comment