Revert "[FEATURE] Add stdWrap to config.additionalHeaders" 17/58517/11
authorMarkus Klein <markus.klein@typo3.org>
Mon, 1 Oct 2018 09:37:52 +0000 (11:37 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Mon, 1 Oct 2018 13:34:16 +0000 (15:34 +0200)
This reverts commit 2124bba49f68f5c35705c5c499abe6a0ee95a6cf.

The feature is reverted as the functionality can't be provided
in a fully working manner to work in all possible cases the FE
may be called.

Change-Id: Ia7caf3770b12737fd195da9d9f66bdc179981de8
Resolves: #86492
Reverts: #23494
Releases: master
Reviewed-on: https://review.typo3.org/58517
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Benjamin Franzke <bfr@qbus.de>
Tested-by: Benjamin Franzke <bfr@qbus.de>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Documentation/Changelog/9.0/Feature-23494-AddStdWrapToConfigadditionalHeaders.rst [deleted file]
typo3/sysext/core/Documentation/Changelog/master/Breaking-86492-RemovedStdWrapSupportForConfigadditionalHeaders.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/t3editor/Resources/Private/tsref.xml

diff --git a/typo3/sysext/core/Documentation/Changelog/9.0/Feature-23494-AddStdWrapToConfigadditionalHeaders.rst b/typo3/sysext/core/Documentation/Changelog/9.0/Feature-23494-AddStdWrapToConfigadditionalHeaders.rst
deleted file mode 100644 (file)
index 5b9d2f8..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-.. include:: ../../Includes.txt
-
-=========================================================
-Feature: #23494 - Add stdWrap to config.additionalHeaders
-=========================================================
-
-See :issue:`23494`
-
-Description
-===========
-
-Add :ts:`stdWrap` to the elements of the :ts:`additionalHeaders` array. This gives full control over sending an HTTP header.
-
-.. code-block:: typoscript
-
-       config.additionalHeaders {
-         10.header = foo:
-         10.header.dataWrap = |{page:uid}
-       }
-
-
-Impact
-======
-
-Allow to use stdWrap on the elements :ts:`header`, :ts:`replace` and :ts:`httpResponseCode`. Empty headers will be skipped now.
-
-.. index:: TypoScript, Frontend
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-86492-RemovedStdWrapSupportForConfigadditionalHeaders.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-86492-RemovedStdWrapSupportForConfigadditionalHeaders.rst
new file mode 100644 (file)
index 0000000..cf8d7e7
--- /dev/null
@@ -0,0 +1,35 @@
+.. include:: ../../Includes.txt
+
+=======================================================================
+Breaking: #86492 - Removed stdWrap support for config.additionalHeaders
+=======================================================================
+
+See :issue:`86492`
+
+Description
+===========
+
+The feature to use :ts:`stdWrap` for :ts:`config.additionalHeaders` has been removed due to
+an incompatibility with page caching.
+
+
+Impact
+======
+
+:ts:`stdWrap` cannot be used anymore to manipulate additional headers set via TypoScript.
+
+
+Affected Installations
+======================
+
+Any TYPO3 instance that uses this feature, which has been introduced with version 9.0.
+
+
+Migration
+=========
+
+For the time being there will be no TypoScript based solution for dynamic HTTP headers.
+
+Consider implementing a PSR-15 middleware to add advanced logic for additional frontend response headers.
+
+.. index:: Frontend, TypoScript, NotScanned, ext:frontend
\ No newline at end of file
index dce5e6f..9baed1d 100644 (file)
@@ -5027,28 +5027,15 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             if (!is_array($options)) {
                 continue;
             }
-            $header = $options['header'] ?? '';
-            $header = isset($options['header.'])
-                ? $this->cObj->stdWrap(trim($header), $options['header.'])
-                : trim($header);
+            $header = trim($options['header'] ?? '');
             if ($header === '') {
                 continue;
             }
-            $replace = $options['replace'] ?? '';
-            $replace = isset($options['replace.'])
-                ? $this->cObj->stdWrap($replace, $options['replace.'])
-                : $replace;
-            $httpResponseCode = $options['httpResponseCode'] ?? '';
-            $httpResponseCode = isset($options['httpResponseCode.'])
-                ? $this->cObj->stdWrap($httpResponseCode, $options['httpResponseCode.'])
-                : $httpResponseCode;
-            $httpResponseCode = (int)$httpResponseCode;
-
             $additionalHeaders[] = [
                 'header' => $header,
                 // "replace existing headers" is turned on by default, unless turned off
-                'replace' => $replace !== '0',
-                'statusCode' => $httpResponseCode ?: null
+                'replace' => ($options['replace'] ?? '') !== '0',
+                'statusCode' => (int)($options['httpResponseCode'] ?? 0) ?: null
             ];
         }
         return $additionalHeaders;
index 2ebcf14..13c124f 100644 (file)
@@ -7092,11 +7092,11 @@ Must at least contain the header property.]]></description>
                </property>
        </type>
        <type id="additionalHeadersItem">
-               <property name="header" type="stdWrap">
+               <property name="header" type="string">
                        <description><![CDATA[The header string]]></description>
                        <default><![CDATA[]]></default>
                </property>
-               <property name="replace" type="stdWrap">
+               <property name="replace" type="boolean">
                        <description><![CDATA[Optional.
 
 If set, previous headers with the same name are replaced with the current one.
@@ -7104,7 +7104,7 @@ If set, previous headers with the same name are replaced with the current one.
 Default is "1".]]></description>
                        <default><![CDATA[1]]></default>
                </property>
-               <property name="httpResponseCode" type="stdWrap">
+               <property name="httpResponseCode" type="int">
                        <description><![CDATA[Optional. HTTP status code as an integer.]]></description>
                        <default><![CDATA[]]></default>
                </property>