X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FRouting%2FContentTypeHeaderMatcher.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FRouting%2FContentTypeHeaderMatcher.php;h=719eeb13289193e074af96bda92dbf2921a70692;hp=13e18f35a9411b07eae2f792290d1d132cef9106;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php b/web/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php index 13e18f35a..719eeb132 100644 --- a/web/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php +++ b/web/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php @@ -4,21 +4,21 @@ namespace Drupal\Core\Routing; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; -use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; /** * Filters routes based on the HTTP Content-type header. */ -class ContentTypeHeaderMatcher implements RouteFilterInterface { +class ContentTypeHeaderMatcher implements FilterInterface { /** * {@inheritdoc} */ public function filter(RouteCollection $collection, Request $request) { // The Content-type header does not make sense on GET requests, because GET - // requests do not carry any content. Nothing to filter in this case. - if ($request->isMethod('GET')) { + // requests do not carry any content. Nothing to filter in this case. Same + // for all other safe methods. + if ($request->isMethodSafe(FALSE)) { return $collection; } @@ -50,11 +50,4 @@ class ContentTypeHeaderMatcher implements RouteFilterInterface { } } - /** - * {@inheritdoc} - */ - public function applies(Route $route) { - return TRUE; - } - }