Skip to content

Commit 705a980

Browse files
committed
add raw cookie support back to response
1 parent 4b1d510 commit 705a980

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Transformers/Response.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ protected function sendHeaders()
8686
$this->swooleResponse->status($illuminateResponse->getStatusCode());
8787

8888
// cookies
89+
// $cookie->isRaw() is supported after symfony/http-foundation 3.1
90+
// and Laravel 5.3, so we can add it back now
8991
foreach ($illuminateResponse->headers->getCookies() as $cookie) {
90-
// may need to consider rawcookie
91-
$this->swooleResponse->cookie(
92+
$method = $cookie->isRaw() ? 'rawcookie' : 'cookie';
93+
$this->swooleResponse->$method(
9294
$cookie->getName(),
9395
$cookie->getValue(),
9496
$cookie->getExpiresTime(),

0 commit comments

Comments
 (0)