File tree 3 files changed +17
-4
lines changed
3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 5
5
### Changed
6
6
7
7
- 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
8
9
9
10
## 1.8.1 - 2018-10-09
10
11
Original file line number Diff line number Diff line change @@ -46,12 +46,24 @@ function it_adds_path(
46
46
$ this ->handleRequest ($ request , function () {}, function () {});
47
47
}
48
48
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
+ ) {
51
55
$ 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 ' );
52
64
53
65
$ this ->beConstructedWith ($ host );
54
- $ this ->shouldThrow ( ' \LogicException ' )-> duringInstantiation ( );
66
+ $ this ->handleRequest ( $ request , function () {}, function () {} );
55
67
}
56
68
57
69
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)
35
35
}
36
36
37
37
if ('/ ' === substr ($ uri ->getPath (), -1 )) {
38
- throw new \ LogicException ( ' URI path cannot end with a slash. ' );
38
+ $ uri = $ uri -> withPath ( rtrim ( $ uri -> getPath (), ' / ' ) );
39
39
}
40
40
41
41
$ this ->uri = $ uri ;
You can’t perform that action at this time.
0 commit comments