core/lib/Drupal/Core/Routing/MethodFilter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/lib/Drupal/Core/Routing/MethodFilter.php b/core/lib/Drupal/Core/Routing/MethodFilter.php index d4687c3..64b8048 100644 --- a/core/lib/Drupal/Core/Routing/MethodFilter.php +++ b/core/lib/Drupal/Core/Routing/MethodFilter.php @@ -27,6 +27,11 @@ public function filter(RouteCollection $collection, Request $request) { foreach ($collection->all() as $name => $route) { $supported_methods = $route->getMethods(); + // If the GET method is allowed we also need to allow the HEAD method + // since HEAD is a GET method that doesn't return the body. + if (in_array('GET', $supported_methods)) { + $supported_methods[] = 'HEAD'; + } // A route not restricted to specific methods allows any method. If this // is the case, we'll also have at least one route left in the collection,