Skip to content

Commit

Permalink
Merge branch 'hotfix/7'
Browse files Browse the repository at this point in the history
Close #7
Fix #6
  • Loading branch information
michalbundyra committed Apr 6, 2020
2 parents 9097314 + 504f2ca commit 0fdf55e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cache:

env:
global:
- COMPOSER_ARGS="--no-interaction"
- COMPOSER_ARGS="--no-interaction --no-plugins"
- COVERAGE_DEPS="php-coveralls/php-coveralls"

matrix:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- [#7](https://github.com/mezzio/mezzio-swoole/pull/7) fixes default value for SameSite in Cookie of Swoole\Http\Response.

## 2.6.1 - 2020-03-28

Expand Down
2 changes: 1 addition & 1 deletion src/SwooleEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private function emitBody(ResponseInterface $response) : void
private function emitCookies(ResponseInterface $response) : void
{
foreach (SetCookies::fromResponse($response)->getAll() as $cookie) {
$sameSite = $cookie->getSameSite() ? substr($cookie->getSameSite()->asString(), 9) : null;
$sameSite = $cookie->getSameSite() ? substr($cookie->getSameSite()->asString(), 9) : '';

$this->swooleResponse->cookie(
$cookie->getName(),
Expand Down
6 changes: 3 additions & 3 deletions test/SwooleEmitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ public function testMultipleSetCookieHeaders()
->header('Set-Cookie', Argument::any())
->shouldNotBeCalled();
$this->swooleResponse
->cookie('foo', 'bar', 0, '/', '', false, false, null)
->cookie('foo', 'bar', 0, '/', '', false, false, '')
->shouldHaveBeenCalled();
$this->swooleResponse
->cookie('bar', 'baz', 0, '/', '', false, false, null)
->cookie('bar', 'baz', 0, '/', '', false, false, '')
->shouldHaveBeenCalled();
$this->swooleResponse
->cookie('baz', 'qux', 1623233894, '/', 'somecompany.co.uk', true, true, null)
->cookie('baz', 'qux', 1623233894, '/', 'somecompany.co.uk', true, true, '')
->shouldHaveBeenCalled();

// SameSite cookies
Expand Down

0 comments on commit 0fdf55e

Please sign in to comment.