File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 55### Changed
66
77- When multiple cookies exist, a single header with all cookies is sent as per RFC 6265 Section 5.4
8+ - AddPathPlugin will now trim of ending slashes in paths
89
910## 1.8.1 - 2018-10-09
1011
Original file line number Diff line number Diff line change @@ -46,12 +46,24 @@ function it_adds_path(
4646 $ this ->handleRequest ($ request , function () {}, function () {});
4747 }
4848
49- function it_throws_exception_on_trailing_slash (UriInterface $ host )
50- {
49+ function it_removes_ending_slashes (
50+ RequestInterface $ request ,
51+ UriInterface $ host ,
52+ UriInterface $ host2 ,
53+ UriInterface $ uri
54+ ) {
5155 $ host ->getPath ()->shouldBeCalled ()->willReturn ('/api/ ' );
56+ $ host2 ->getPath ()->shouldBeCalled ()->willReturn ('/api ' );
57+ $ host ->withPath ('/api ' )->shouldBeCalled ()->willReturn ($ host2 );
58+
59+ $ request ->getUri ()->shouldBeCalled ()->willReturn ($ uri );
60+ $ request ->withUri ($ uri )->shouldBeCalled ()->willReturn ($ request );
61+
62+ $ uri ->withPath ('/api/users ' )->shouldBeCalled ()->willReturn ($ uri );
63+ $ uri ->getPath ()->shouldBeCalled ()->willReturn ('/users ' );
5264
5365 $ this ->beConstructedWith ($ host );
54- $ this ->shouldThrow ( ' \LogicException ' )-> duringInstantiation ( );
66+ $ this ->handleRequest ( $ request , function () {}, function () {} );
5567 }
5668
5769 function it_throws_exception_on_empty_path (UriInterface $ host )
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public function __construct(UriInterface $uri)
3535 }
3636
3737 if ('/ ' === substr ($ uri ->getPath (), -1 )) {
38- throw new \ LogicException ( ' URI path cannot end with a slash. ' );
38+ $ uri = $ uri -> withPath ( rtrim ( $ uri -> getPath (), ' / ' ) );
3939 }
4040
4141 $ this ->uri = $ uri ;
You can’t perform that action at this time.
0 commit comments