Skip to content

Commit

Permalink
Merge branch '1.4.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Dec 16, 2016
2 parents 1761cb6 + bfd895a commit 69e4723
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# Change Log


## Unreleased

### Deprecated

- FilteredStream::getReadFilter The read filter is internal and should never be used by consuming code.
- FilteredStream::getWriteFilter We did not implement writing to the streams at all. And if we do, the filter is an internal information and should not be used by consuming code.


## 1.4.1 - 2016-12-16

### Fixed

- Cookie::matchPath Cookie with root path (`/`) will not match sub path (e.g. `/cookie`).


## 1.4.0 - 2016-10-20

### Added
Expand All @@ -15,6 +24,7 @@
- BufferedStream that allow you to decorate a non-seekable stream with a seekable one.
- cUrlFormatter to be able to redo the request with a cURL command


## 1.3.1 - 2016-07-15

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions spec/CookieSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ function it_matches_a_path()
$this->beConstructedWith('name', 'value', null, null, '/path/to/somewhere');

$this->matchPath('/path/to/somewhere')->shouldReturn(true);
$this->matchPath('/path/to/somewhere/else')->shouldReturn(true);
$this->matchPath('/path/to/somewhereelse')->shouldReturn(false);
}

Expand All @@ -197,6 +198,8 @@ function it_matches_the_root_path()
$this->beConstructedWith('name', 'value', null, null, '/');

$this->matchPath('/')->shouldReturn(true);
$this->matchPath('/cookies')->shouldReturn(true);
$this->matchPath('/cookies/')->shouldReturn(true);
}

function it_is_secure()
Expand Down
2 changes: 1 addition & 1 deletion src/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function withPath($path)
*/
public function matchPath($path)
{
return $this->path === $path || (strpos($path, $this->path.'/') === 0);
return $this->path === $path || (strpos($path, rtrim($this->path, '/').'/') === 0);
}

/**
Expand Down

0 comments on commit 69e4723

Please sign in to comment.