Review main Merged

93092[BUGFIX] Sync displayed HTTP status code with actual response header in ProductionExceptionHandler

Josua Vogel CR +2 V +2 Normal +81 −7 updated 05/28/26, 20:46

Commit message

When an unhandled exception reaches the ProductionExceptionHandler,
`sendStatusHeaders()` derives the HTTP response code from the exception
(500 for generic exceptions, or the code from `getStatusHeaders()` for
typed HTTP exceptions like ServiceUnavailableException). However, the
call to `errorAction()` passed a hardcoded `503` as the display value,
causing a permanent mismatch between the actual HTTP response header
and the status code shown on the error page.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Markus Klein +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Markus Klein +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 3

Review log 1620

  1. Josua Vogel uploaded patch set 1 03/05/26, 19:01

  2. core-ci voted on patch set 1 V +1 03/05/26, 19:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97433

  3. Garvin Hicking commented on patch set 1 03/14/26, 21:19

    I have a small tingling feeling this might be better to do in main only...?

    ProductionExceptionHandler.php:154

    I feel like for BC of proxy/setup handling we should probably keep 503 as fallback instead of 500 here?
  4. Josua Vogel commented on patch set 2 V +1 03/16/26, 07:12

    Published edit on patch set 1.
  5. core-ci voted on patch set 2 V +1 03/16/26, 07:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97986

  6. Josua Vogel commented on patch set 2 03/16/26, 07:25

    Reply

    Done

    ProductionExceptionHandler.php:154 Reply

    That's fine with me
  7. Garvin Hicking voted on patch set 2 CR +1 V +1 03/16/26, 08:06

  8. Markus Klein commented on patch set 2 03/16/26, 08:08

    ProductionExceptionHandler.php:144

    that's wrong. 503 is returned instead

    ProductionExceptionHandler.php:148

    I'm not sure on this implementation way. yes, we duck-type in the other method as well; still not nice. On top we assume the status to be part of the first header. Is this always true?? The regex catches any 3-digit number somewhere in the header.
  9. Garvin Hicking voted on patch set 2 CR 0 V 0 03/16/26, 08:22

  10. Josua Vogel uploaded patch set 3 V +1 05/22/26, 11:59

  11. Josua Vogel commented on patch set 3 05/22/26, 12:00

    ProductionExceptionHandler.php:144 Reply

    Done

    ProductionExceptionHandler.php:148 Reply

    Done
  12. core-ci voted on patch set 3 V -1 05/22/26, 12:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102351

  13. Josua Vogel uploaded patch set 4 V -1 05/26/26, 05:30

  14. core-ci voted on patch set 4 V +1 05/26/26, 05:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102427

  15. Oliver Klee voted on patch set 4 CR +1 V +1 05/26/26, 07:01

  16. Markus Klein voted on patch set 4 CR +1 V +1 05/26/26, 07:36

  17. Christian Kuhn commented on patch set 4 05/28/26, 20:30

    AbstractExceptionHandler.php:226

    this is ugly: the httpUtility constants should probably be backed enums with string value for the explanation and the 3 digit code, the exceptions should then carry that enum around. that's a topic for later, though. but it explains the need for this code.
  18. Stefan Bürk voted on patch set 4 CR +1 V +1 05/28/26, 20:38

  19. Christian Kuhn voted on patch set 4 CR +2 V +2 05/28/26, 20:38

  20. Christian Kuhn merged patch set 5 05/28/26, 20:46