Commit 61375924 authored by catch's avatar catch

Issue #2417917 by clemens.tolboom, sudhanshug, Wim Leers, joelpittet: Include...

Issue #2417917 by clemens.tolboom, sudhanshug, Wim Leers, joelpittet: Include content type format name in error response
parent 805a22e9
......@@ -47,7 +47,7 @@ public function filter(RouteCollection $collection, Request $request) {
// We do not throw a
// \Symfony\Component\Routing\Exception\ResourceNotFoundException here
// because we don't want to return a 404 status code, but rather a 415.
throw new UnsupportedMediaTypeHttpException('No route found that matches the Content-Type header.');
throw new UnsupportedMediaTypeHttpException('No route found that matches "Content-Type: ' . $request->headers->get('Content-Type') . '"');
}
/**
......
......@@ -94,7 +94,7 @@ public function testPostForm() {
* Confirms that the matcher throws an exception for no-route.
*
* @expectedException \Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException
* @expectedExceptionMessage No route found that matches the Content-Type header.
* @expectedExceptionMessage No route found that matches "Content-Type: application/hal+json"
*/
public function testNoRouteFound() {
$matcher = new ContentTypeHeaderMatcher();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment