You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this GET http://127.0.0.1:8000/ will return the Symfony welcome page (404) instead of the automatic redirection to https (301) and finally the expected "Method not allowed" (405) exception.
Currently, there is a test case that exactly covers the previous scenario and a pure ResourceNotFoundException is expected due to the https scheme mismatch:
…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
Symfony versions affected: 3.4, 4.2, master
Given the following route definition:
this
GET http://127.0.0.1:8000/
will return the Symfony welcome page (404) instead of the automatic redirection tohttps
(301) and finally the expected "Method not allowed" (405) exception.Currently, there is a test case that exactly covers the previous scenario and a pure
ResourceNotFoundException
is expected due to thehttps
scheme mismatch:symfony/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
Lines 493 to 503 in 287da8d
now it's working because
NoConfigurationException
extends fromResourceNotFoundException
.How to reproduce
Just changes
ResourceNotFoundException
byNoConfigurationException
in the test case and look how it pass.Possible Solution
Still working on it... hints are welcome.
By now, I'm trying to collect
$this->allowSchemes
as was done in 4.2 and update this line:symfony/src/Symfony/Component/Routing/Matcher/UrlMatcher.php
Lines 79 to 81 in 287da8d
We might need a separate bugfix PR for 4.2+
The text was updated successfully, but these errors were encountered: