-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Fixed unexpected 404 NoConfigurationException #31207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -88,7 +88,7 @@ public function match($pathinfo) | ||
return $ret; | ||
} | ||
|
||
if ('/' === $pathinfo && !$this->allow) { | ||
if ('/' === $pathinfo && !$this->allow && !$this->allowSchemes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to what we have in PhpMatcherTrait
:
symfony/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherTrait.php
Lines 176 to 178 in e479b69
if ('/' === $pathinfo && !$allow && !$allowSchemes) { | |
throw new NoConfigurationException(); | |
} |
@@ -582,6 +582,7 @@ public function testNestedCollections() | ||
|
||
/** | ||
* @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException | ||
* @expectedExceptionMessage No routes found for "/". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making sure it is a ResourceNotFoundException
and not a NoConfigurationException
which has no message.
|
||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this continue
outside the if ($hasRequiredScheme)
was preventing to collect the $this->allowSchemes
bellow
(Travis failures are unrelated) |
0693bb9
to
64579e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for 4.2 thanks.
For 3.4, what's your advice?
For 3.4 we need to collect |
@nicolas-grekas I just rebased to make tests pass, but I lost your changes, I'm sorry :( please, feel free to push them again, thanks! |
08fbf74
to
aa71a42
Compare
Or we can forget about it - 4.2 has new features that allow making the difference - 3.4 doesn't. Makes sense? I added back my changes. |
Thank you @yceruto. |
…ceruto) This PR was merged into the 4.2 branch. Discussion ---------- [Routing] Fixed unexpected 404 NoConfigurationException | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31199 | License | MIT This is the patch for 4.2+ We need a different patch for 3.4 that is more complex, I think. Commits ------- aa71a42 [Routing] Fixed unexpected 404 NoConfigurationException
It's fine to me, thanks for merging. |
This is the patch for 4.2+
We need a different patch for 3.4 that is more complex, I think.