diff -u b/core/lib/Drupal/Core/Controller/AjaxController.php b/core/lib/Drupal/Core/Controller/AjaxController.php --- b/core/lib/Drupal/Core/Controller/AjaxController.php +++ b/core/lib/Drupal/Core/Controller/AjaxController.php @@ -48,7 +48,8 @@ // Remove the accept header so the subrequest does not end up back in this // controller. $request->headers->remove('accept'); - // @todo Explain why this is needed. + // Remove the header in order to let the subrequest not think that it's an + // ajax request, see \Drupal\Core\ContentNegotiation. $request->headers->remove('x-requested-with'); $response = $this->container->get('http_kernel')->forward($controller, $attributes->all(), $request->query->all());