Bug #101001
closedEase hard type check on custom HTTP headers
100%
Description
Just had to debug why my custom header did not end up in response.
<?php
namespace MyClient\MyExt\Controller;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\JsonResponse;
class DemoController extends AbstractController
{
public function ajaxAction(): ResponseInterface
{
return new JsonResponse([], 200, ['X-Page' => 123]);
}
}
The header will be skipped due to hard checks on the correct type and does not throw any notice in `\TYPO3\CMS\Core\Http\Message::filterHeaders`.
It would be nice to:
- get a notice thrown on invalid headers, easing the developer experience
- allow header values to go through https://www.php.net/manual/de/function.strval.php, therefore allowing any string representation of a given value and the support for classes that implement https://www.php.net/manual/de/class.stringable.php.
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79589
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79589
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79589
Updated by Gerrit Code Review over 1 year ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79589
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79780
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79781
Updated by Benni Mack over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d295723f5502cecd9864ea2f5957e70497a2957a.