diff --git b/core/includes/batch.inc a/core/includes/batch.inc index 84291ae..60e8fc8 100644 --- b/core/includes/batch.inc +++ a/core/includes/batch.inc @@ -18,8 +18,8 @@ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Batch\Percentage; use Drupal\Core\Form\FormState; +use Drupal\Core\Render\JsonResponse; use Drupal\Core\Url; -use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RedirectResponse; diff --git b/core/lib/Drupal/Core/Render/HtmlResponse.php a/core/lib/Drupal/Core/Render/HtmlResponse.php index 555e504..1241cfa 100644 --- b/core/lib/Drupal/Core/Render/HtmlResponse.php +++ a/core/lib/Drupal/Core/Render/HtmlResponse.php @@ -5,7 +5,6 @@ use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\CacheableResponseInterface; use Drupal\Core\Cache\CacheableResponseTrait; -use Symfony\Component\HttpFoundation\Response; /** * A response that contains and can expose cacheability metadata and attachments. diff --git b/core/lib/Drupal/Core/Render/JsonResponse.php a/core/lib/Drupal/Core/Render/JsonResponse.php new file mode 100644 index 0000000..28ce9a9 --- /dev/null +++ a/core/lib/Drupal/Core/Render/JsonResponse.php @@ -0,0 +1,16 @@ +sendHeaders(); + $this->sendContent(); + + if (!$this->shutdownFunctionRegistered() && function_exists('fastcgi_finish_request')) { + fastcgi_finish_request(); + } + elseif ('cli' !== PHP_SAPI) { + static::closeOutputBuffers(0, TRUE); + } + return $this; + } + + /** + * Determines if shutdown functions are registered. + * + * @return bool + * True if any shutdown functions are registered. + */ + protected function shutdownFunctionRegistered() { + return drupal_register_shutdown_function() ? TRUE : FALSE; + } + +}