Review 11.5 Merged

72310[BUGFIX] Catch ImmediateResponseException in Application->handle()

Christian Kuhn CR +2 V +2 Easy +10 −12 updated 11/27/21, 23:14

Commit message

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.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 1

Files 1

Review log 34

  1. Christian Kuhn commented on patch set 1 11/27/21, 22:59

    Cherry Picked from branch master.
  2. core-ci voted on patch set 1 V +1 11/27/21, 23:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19904

  3. Christian Kuhn voted on patch set 1 V +2 CR +2 11/27/21, 23:14

  4. Christian Kuhn merged patch set 2 11/27/21, 23:14