Skip to content

Commit bc35515

Browse files
committed
BUGFIX: Keep trailing slashe on target uri
Some systems depend on the trailing slash and as we can redirect to other uris we have to allow appending slashes
1 parent 4798e18 commit bc35515

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Tests/Functional/RedirectTests.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function setUp()
5252
/**
5353
* @test
5454
*/
55-
public function addRedirectTrimsLeadingAndTrailingSlashesOfSourceAndTargetPath()
55+
public function addRedirectTrimsLeadingAndTrailingSlashesOfSourcePath()
5656
{
5757
$this->assertEquals(0, $this->redirectRepository->countAll());
5858
$this->redirectStorage->addRedirect('/some/source/path/', '/some/target/path/');
@@ -62,7 +62,21 @@ public function addRedirectTrimsLeadingAndTrailingSlashesOfSourceAndTargetPath()
6262
$redirect = $this->redirectRepository->findAll()->current();
6363

6464
$this->assertSame('some/source/path', $redirect->getSourceUriPath());
65-
$this->assertSame('some/target/path', $redirect->getTargetUriPath());
65+
}
66+
67+
/**
68+
* @test
69+
*/
70+
public function addRedirectTrimsLeadingSlashesOfTargetPath()
71+
{
72+
$this->assertEquals(0, $this->redirectRepository->countAll());
73+
$this->redirectStorage->addRedirect('/some/source/path/', '/some/target/path/');
74+
75+
$this->persistenceManager->persistAll();
76+
/** @var RedirectInterface $redirect */
77+
$redirect = $this->redirectRepository->findAll()->current();
78+
79+
$this->assertSame('some/target/path/', $redirect->getTargetUriPath());
6680
}
6781

6882
/**

0 commit comments

Comments
 (0)