Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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

Merged
merged 1 commit into from
May 9, 2019

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Apr 23, 2019

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.

@@ -88,7 +88,7 @@ public function match($pathinfo)
return $ret;
}

if ('/' === $pathinfo && !$this->allow) {
if ('/' === $pathinfo && !$this->allow && !$this->allowSchemes) {
Copy link
Member Author

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:

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 "/".
Copy link
Member Author

@yceruto yceruto Apr 23, 2019

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;
Copy link
Member Author

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

@yceruto
Copy link
Member Author

yceruto commented Apr 23, 2019

(Travis failures are unrelated)

@nicolas-grekas nicolas-grekas force-pushed the fix_routing_42 branch 2 times, most recently from 0693bb9 to 64579e8 Compare May 5, 2019 15:49
Copy link
Member

@nicolas-grekas nicolas-grekas left a 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?

@yceruto
Copy link
Member Author

yceruto commented May 6, 2019

For 3.4 we need to collect allowSchemes in a different way (also different places) because the code as of 4.2 has been completely refactored. I still haven't found the right way to do it.

@yceruto
Copy link
Member Author

yceruto commented May 8, 2019

@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!

@nicolas-grekas
Copy link
Member

For 3.4 we need to collect allowSchemes in a different way

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.

@nicolas-grekas
Copy link
Member

Thank you @yceruto.

@nicolas-grekas nicolas-grekas merged commit aa71a42 into symfony:4.2 May 9, 2019
nicolas-grekas added a commit that referenced this pull request May 9, 2019
…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
@yceruto yceruto deleted the fix_routing_42 branch May 9, 2019 12:06
@yceruto
Copy link
Member Author

yceruto commented May 9, 2019

For 3.4 we need to collect allowSchemes in a different way

Or we can forget about it - 4.2 has new features that allow making the difference - 3.4 doesn't. Makes sense?

It's fine to me, thanks for merging.

This was referenced May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.