Skip to content

Commit a5784c2

Browse files
committed
[Routing] Fixed scheme redirecting for root path
1 parent 6912cfe commit a5784c2

16 files changed

+29
-15
lines changed

Matcher/Dumper/PhpMatcherDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private function compileRoutes(RouteCollection $routes, bool $matchHost): string
194194
}
195195

196196
// used to display the Welcome Page in apps that don't define a homepage
197-
$code .= " if ('/' === \$pathinfo && !\$allow) {\n";
197+
$code .= " if ('/' === \$pathinfo && !\$allow && !\$allowSchemes) {\n";
198198
$code .= " throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n";
199199
$code .= " }\n";
200200

Tests/Fixtures/dumper/url_matcher0.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function match($rawPathinfo)
2626
$canonicalMethod = 'GET';
2727
}
2828

29-
if ('/' === $pathinfo && !$allow) {
29+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
3030
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
3131
}
3232

Tests/Fixtures/dumper/url_matcher1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public function match($rawPathinfo)
238238
$offset += strlen($m);
239239
}
240240
}
241-
if ('/' === $pathinfo && !$allow) {
241+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
242242
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
243243
}
244244

Tests/Fixtures/dumper/url_matcher10.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2821,7 +2821,7 @@ public function match($rawPathinfo)
28212821
$offset += strlen($m);
28222822
}
28232823
}
2824-
if ('/' === $pathinfo && !$allow) {
2824+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
28252825
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
28262826
}
28272827

Tests/Fixtures/dumper/url_matcher11.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a
142142
$offset += strlen($m);
143143
}
144144
}
145-
if ('/' === $pathinfo && !$allow) {
145+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
146146
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
147147
}
148148

Tests/Fixtures/dumper/url_matcher12.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function match($rawPathinfo)
9191
$offset += strlen($m);
9292
}
9393
}
94-
if ('/' === $pathinfo && !$allow) {
94+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
9595
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
9696
}
9797

Tests/Fixtures/dumper/url_matcher13.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function match($rawPathinfo)
6060
$offset += strlen($m);
6161
}
6262
}
63-
if ('/' === $pathinfo && !$allow) {
63+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
6464
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
6565
}
6666

Tests/Fixtures/dumper/url_matcher2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a
275275
$offset += strlen($m);
276276
}
277277
}
278-
if ('/' === $pathinfo && !$allow) {
278+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
279279
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
280280
}
281281

Tests/Fixtures/dumper/url_matcher3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function match($rawPathinfo)
103103
$offset += strlen($m);
104104
}
105105
}
106-
if ('/' === $pathinfo && !$allow) {
106+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
107107
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
108108
}
109109

Tests/Fixtures/dumper/url_matcher4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function match($rawPathinfo)
7575
return $ret;
7676
}
7777

78-
if ('/' === $pathinfo && !$allow) {
78+
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
7979
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
8080
}
8181

0 commit comments

Comments
 (0)