Skip to content
Snippets Groups Projects
Commit 3a6c6ee3 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[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: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 5d65bec7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment