diff --git a/CHANGELOG.md b/CHANGELOG.md index a227651f..b3ada73d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 1.3.3 - TBD +## 1.3.3 - 2016-01-04 ### Added @@ -18,7 +18,11 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [#135](https://github.com/zendframework/zend-diactoros/pull/135) fixes the + behavior of `ServerRequestFactory::marshalHeaders()` to no longer omit + `Cookie` headers from the aggregated headers. While the values are parsed and + injected into the cookie params, it's useful to have access to the raw headers + as well. ## 1.3.2 - 2015-12-22 diff --git a/src/ServerRequestFactory.php b/src/ServerRequestFactory.php index 2fc97b53..7b68c859 100644 --- a/src/ServerRequestFactory.php +++ b/src/ServerRequestFactory.php @@ -198,11 +198,6 @@ public static function marshalHeaders(array $server) { $headers = []; foreach ($server as $key => $value) { - if (strpos($key, 'HTTP_COOKIE') === 0) { - // Cookies are handled using the $_COOKIE superglobal - continue; - } - if ($value && strpos($key, 'HTTP_') === 0) { $name = strtr(substr($key, 5), '_', ' '); $name = strtr(ucwords(strtolower($name)), ' ', '-'); diff --git a/test/ServerRequestFactoryTest.php b/test/ServerRequestFactoryTest.php index dc69e9d8..b34eccf3 100644 --- a/test/ServerRequestFactoryTest.php +++ b/test/ServerRequestFactoryTest.php @@ -69,6 +69,7 @@ public function testMarshalsExpectedHeadersFromServerArray() ]; $expected = [ + 'cookie' => 'COOKIE', 'authorization' => 'token', 'content-type' => 'application/json', 'accept' => 'application/json',