diff --git a/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php b/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php index 7d66b50ecefd80ce5b5584fc07217030d85e54b8..d6452e8be03e6b9c1576c4a585d4cb2db4d2bce7 100644 --- a/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php +++ b/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php @@ -42,7 +42,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. - if (!$request->headers->has('Content-Type')) { + if (!$request->headers->get('Content-Type', FALSE)) { throw new UnsupportedMediaTypeHttpException('No "Content-Type" request header specified'); } else {