Skip to content
Snippets Groups Projects
Commit 36b63a8c authored by Stefan Bürk's avatar Stefan Bürk
Browse files

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

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.

Resolves: #103399
Related: #98396
Related: #94402
Releases: main, 12.4
Change-Id: If09158abd2aa9246bcb7a4fa41a0ad6e4a0f942c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83947


Reviewed-by: default avatarThomas Hohn <tho@gyldendal.dk>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
parent ea143a3c
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