Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] X-Redirect-By Header for pages with redirect types
To make debugging easier and to be in sync with redirects by EXT:redirects, page doktypes which trigger a redirect now also provide the header X-Redirect-By. Resolves: #92334 Releases: master Change-Id: Ia01e358b5cb50dcac4d57f8469f572cf7eaaaedd Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65752 Tested-by: Josef Glatz <josefglatz@gmail.com> Tested-by: Oliver Bartsch <bo@cedev.de> Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Richard Haeser <richard@richardhaeser.com> Reviewed-by: Josef Glatz <josefglatz@gmail.com> Reviewed-by: Oliver Bartsch <bo@cedev.de> Reviewed-by: Richard Haeser <richard@richardhaeser.com>
- Loading branch information
1 parent
20658a4
commit 091b642
Showing
5 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...Changelog/master/Feature-92334-X-Redirect-ByHeaderForPagesWithRedirectTypes.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.. include:: ../../Includes.txt | ||
|
||
==================================================================== | ||
Feature: #92334 - X-Redirect-By Header for pages with redirect types | ||
==================================================================== | ||
|
||
See :issue:`92334` | ||
|
||
Description | ||
=========== | ||
|
||
The following page types trigger a redirect: | ||
|
||
- Shortcut | ||
- Mountpoint pages which should be overlaid but accessed directly | ||
- Link to external URL | ||
|
||
Those redirects will now send an additional HTTP Header `X-Redirect-By`, stating what type of page triggered the redirect. | ||
By enabling the new global option :php:`$GLOBALS['TYPO3_CONF_VARS']['FE']['exposeRedirectInformation']` the header will also contain the page ID. | ||
As this exposes internal information about the TYPO3 system publicly, it should only be enabled for debugging purposes. | ||
|
||
For shortcut and mountpoint pages: :: | ||
|
||
X-Redirect-By: TYPO3 Shortcut/Mountpoint | ||
# exposeRedirectInformation is enabled | ||
X-Redirect-By: TYPO3 Shortcut/Mountpoint at page with ID 123 | ||
|
||
For *Links to External URL*: :: | ||
|
||
X-Redirect-By: TYPO3 External URL | ||
# exposeRedirectInformation is enabled | ||
X-Redirect-By: TYPO3 External URL at page with ID 456 | ||
|
||
Impact | ||
====== | ||
|
||
The header `X-Redirect-By` makes it easier to understand why a redirect happens when checking URLs, e.g. by using `curl`: :: | ||
|
||
curl -I 'https://my-typo3-site.com/examples/pages/link-to-external-url/' | ||
|
||
HTTP/1.1 303 See Other | ||
Date: Thu, 17 Sep 2020 17:45:34 GMT | ||
X-Redirect-By: TYPO3 External URL at page with ID 12 | ||
X-TYPO3-Parsetime: 0ms | ||
location: https://typo3.org | ||
Cache-Control: max-age=0 | ||
Expires: Thu, 17 Sep 2020 17:45:34 GMT | ||
X-UA-Compatible: IE=edge | ||
Content-Type: text/html; charset=UTF-8 | ||
|
||
.. index:: Frontend, ext:frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters