[BUGFIX] Allow to send multiple HTTP headers with the same name 00/60800/2
authorMarkus Poerschke <poerschke@cvc.digital>
Thu, 23 May 2019 07:22:19 +0000 (09:22 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 24 May 2019 13:06:16 +0000 (15:06 +0200)
HTTP allows to send multiple headers with the same name.
Espacially this is needed for the "Set-Cookie" header to send more than
one cookie at the same response.

Resolves: #88420
Releases: master, 9.5
Change-Id: I4fd3573424e2ebf954cc5ebd043bd710226897fa
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60800
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Susanne Moog <look@susi.dev>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/Http/AbstractApplication.php

index 66627a7..74fe660 100644 (file)
@@ -74,7 +74,9 @@ abstract class AbstractApplication implements ApplicationInterface
             }
 
             foreach ($response->getHeaders() as $name => $values) {
-                header($name . ': ' . implode(', ', $values));
+                foreach ($values as $value) {
+                    header($name . ': ' . $value, false);
+                }
             }
         }
         $body = $response->getBody();