-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Show full URI when route not found #39893
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
Hey! This is.. this is amazing. Thank you! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
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.
can you please add a test case?
@nicolas-grekas Added some tests. |
src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
Outdated
Show resolved
Hide resolved
When accessing a route that does not exist, Symfony throws a `NotFoundHttpException` that says `No route found for "POST /path"`. On some projects this might be good enough to find the root cause, but on projects that have lots of routes on different hosts, it becomes hard to understand how the request was initiated. Was it done over HTTP or HTTPS? What was the hostname? Did the user specify a port? To make this easier, we now show the full URI of the path, like this: `No route found for "POST https://www.symfony.com/path"`.
src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
Show resolved
Hide resolved
Thank you @ruudk. |
When accessing a route that does not exist, Symfony throws a
NotFoundHttpException
that saysNo route found for "POST /path"
.On some projects this might be good enough to find the root cause, but on projects that have lots of routes on different hosts, it becomes hard to understand how the request was initiated. Was it done over HTTP or HTTPS? What was the hostname? Did the user specify a port?
To make this easier, we now show the full URI of the path, like this:
No route found for "POST https://www.symfony.com/path"
.