Skip to content

Commit 8467b9c

Browse files
[Routing] Revert throwing 405 on missed slash/scheme redirections
1 parent 48ee6df commit 8467b9c

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

Matcher/Dumper/PhpMatcherDumper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren
264264
if ('/' === substr(\$pathinfo, -1)) {
265265
// no-op
266266
} elseif (!in_array(\$this->context->getMethod(), array('HEAD', 'GET'))) {
267-
\$allow[] = 'GET';
268267
goto $gotoname;
269268
} else {
270269
return \$this->redirect(\$rawPathinfo.'/', '$name');
@@ -283,7 +282,6 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren
283282
\$requiredSchemes = $schemes;
284283
if (!isset(\$requiredSchemes[\$this->context->getScheme()])) {
285284
if (!in_array(\$this->context->getMethod(), array('HEAD', 'GET'))) {
286-
\$allow[] = 'GET';
287285
goto $gotoname;
288286
}
289287

Tests/Fixtures/dumper/url_matcher2.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function match($rawPathinfo)
6969
if ('/' === substr($pathinfo, -1)) {
7070
// no-op
7171
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
72-
$allow[] = 'GET';
7372
goto not_baz3;
7473
} else {
7574
return $this->redirect($rawPathinfo.'/', 'baz3');
@@ -86,7 +85,6 @@ public function match($rawPathinfo)
8685
if ('/' === substr($pathinfo, -1)) {
8786
// no-op
8887
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
89-
$allow[] = 'GET';
9088
goto not_baz4;
9189
} else {
9290
return $this->redirect($rawPathinfo.'/', 'baz4');
@@ -185,7 +183,6 @@ public function match($rawPathinfo)
185183
if ('/' === substr($pathinfo, -1)) {
186184
// no-op
187185
} elseif (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
188-
$allow[] = 'GET';
189186
goto not_hey;
190187
} else {
191188
return $this->redirect($rawPathinfo.'/', 'hey');
@@ -337,7 +334,6 @@ public function match($rawPathinfo)
337334
$requiredSchemes = array ( 'https' => 0,);
338335
if (!isset($requiredSchemes[$this->context->getScheme()])) {
339336
if (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
340-
$allow[] = 'GET';
341337
goto not_secure;
342338
}
343339

@@ -353,7 +349,6 @@ public function match($rawPathinfo)
353349
$requiredSchemes = array ( 'http' => 0,);
354350
if (!isset($requiredSchemes[$this->context->getScheme()])) {
355351
if (!in_array($this->context->getMethod(), array('HEAD', 'GET'))) {
356-
$allow[] = 'GET';
357352
goto not_nonsecure;
358353
}
359354

Tests/Matcher/DumpedRedirectableUrlMatcherTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919

2020
class DumpedRedirectableUrlMatcherTest extends RedirectableUrlMatcherTest
2121
{
22-
/**
23-
* @expectedException \Symfony\Component\Routing\Exception\MethodNotAllowedException
24-
*/
25-
public function testRedirectWhenNoSlashForNonSafeMethod()
26-
{
27-
parent::testRedirectWhenNoSlashForNonSafeMethod();
28-
}
29-
3022
protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
3123
{
3224
static $i = 0;

0 commit comments

Comments
 (0)