Review 12.4 Merged

83978[BUGFIX] Use Guzzle request to fetch external error page content

Stefan Bürk CR +2 V +2 Normal +62 −0 updated 04/23/24, 22:23

Commit message

TYPO3 provides the ability to configure different error handlers for
specific (or all) error codes, as well as the error handler type
to use (core handler or custom).

The `\TYPO3\CMS\Core\Error\PageErrorHandler\PageContentErrorHandler`
allows to specify a target using the link handler. The default config
allows to define `LinkService::TYPE_PAGE` and `LinkService::TYPE_URL`.

After implementing and stabilizing the TYPO3 sub-request feature,
this particular error handler has been refactored to use an internal
sub-request to resolve the error page content: An external URL not
matching the same instance or having a page unavailable within
the TYPO3 instance will not return any content.

This change modifies the `PageContentErrorHandler` to send a Guzzle
request for an external URL instead of using internal sub-requests,
even if it would access the originating instance again. A limitation
is that the requested URL **must** return a HTTP status-code 200.

A custom request header is attached to this request. It is then
checked to avoid recurring errors or loops in the page-resolving
workflow.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 3

Files 2

Review log 34

  1. Stefan Bürk commented on patch set 1 04/23/24, 22:16

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 04/23/24, 22:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56614

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 04/23/24, 22:23

  4. Stefan Bürk merged patch set 2 04/23/24, 22:23