Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 9fff83e

Browse files
committed
Include COOKIE header in request headers
> Cookies *are* available in $_COOKIE, and hence also the cookie params, but > there may be times you want raw access to the header. There's no good > reason to omit the header from the request. -- @weierophinney
1 parent a2bdb46 commit 9fff83e

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/ServerRequestFactory.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ public static function marshalHeaders(array $server)
198198
{
199199
$headers = [];
200200
foreach ($server as $key => $value) {
201-
if (strpos($key, 'HTTP_COOKIE') === 0) {
202-
// Cookies are handled using the $_COOKIE superglobal
203-
continue;
204-
}
205-
206201
if ($value && strpos($key, 'HTTP_') === 0) {
207202
$name = strtr(substr($key, 5), '_', ' ');
208203
$name = strtr(ucwords(strtolower($name)), ' ', '-');

test/ServerRequestFactoryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function testMarshalsExpectedHeadersFromServerArray()
6969
];
7070

7171
$expected = [
72+
'cookie' => 'COOKIE',
7273
'authorization' => 'token',
7374
'content-type' => 'application/json',
7475
'accept' => 'application/json',

0 commit comments

Comments
 (0)