Actions
Bug #84171
closed\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl() Request-Header format changed from array of strings to associative array in GuzzleHttp conversion
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2018-03-07
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:
Description
In TYPO3 8 the cURL based implementation \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl()
was replaced with GuzzleHttp in #70056.
This introduced a breaking change in how http headers are passed.
In the old implementation HTTP request headers where passed as an array of strings:
$url = 'https://typo3.org';
$requestHeaders = ['Accept: application/json', 'X-Foo: Bar', 'X-Foo: Baz'];
GeneralUtility::getUrl($url, 0, $requestHeaders);
In the new implementation the $requestHeaders
are passed through to guzzle as part of the headers
option, which wants the following format:
$url = 'https://typo3.org';
$requestHeaders = ['Accept' => 'application/json', 'X-Foo' => ['Bar', 'Baz']];
GeneralUtility::getUrl($url, 0, $requestHeaders);
Due to the different format code that uses GeneralUtility::getUrl()
and requires request headers breaks when upgrading from TYPO3 7 to 8 or 9.
I think this is a bug and not an intentional change, since all the changes made as part of #70056 try to emulate the old cURL behavior of getUrl()
.
Actions