Fix PHP Warning: Undefined array key 0
@codegm Thanks a lot for taking the time to create this PR. Can you elaborate in what scenario this header is not sent and you run into issues? Could be that something else also needs to be fixed.
It is a redirect response after submiting an ext:form with redirect as last finisher.
TYPO3\CMS\Core\Http\RedirectResponseprototypeobject statusCode => protected303 (integer) reasonPhrase => protected'See Other' (9 chars) availableStatusCodes => protectedarray(64 items) protocolVersion => protected'1.1' (3 chars) headers => protectedarray(1 item) location => array(1 item) 0 => 'https://www....' (49 chars) lowercasedHeaderNames => protectedarray(1 item) body => protectedTYPO3\CMS\Core\Http\Streamprototypeobject
Hope this helps...
Hey @helhum I get this warning also with php 8.1 on my forms. The form is a programmatically created ext:form form with a redirect finisher:
public function build(array $configuration, string $prototypeName = null): FormDefinition
{
[...]
$form->createFinisher('Redirect', ['pageUid' => 366]);
$this->triggerFormBuildingFinished($form);
return $form;
}

And I can confirm that the patch works :-)
@schliesser @codegm @oliverklee I pushed now a third alternative approach to #88
Can you verify this would work for you as well? Thanks!