Skip to content
Snippets Groups Projects

Issue #3392196: Exceptions in batch no longer are shown on the page

Open Issue #3392196: Exceptions in batch no longer are shown on the page

Files

@@ -12,7 +12,6 @@
@@ -12,7 +12,6 @@
use Drupal\Core\Site\Settings;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -304,14 +303,27 @@ protected function setExpiresNoCache(Response $response) {
@@ -304,14 +303,27 @@ protected function setExpiresNoCache(Response $response) {
*
*
* @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The event to process.
* The event to process.
 
*
 
* @see \Symfony\Component\HttpFoundation\Response::prepare()
 
* @see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length
*/
*/
public function setContentLengthHeader(ResponseEvent $event): void {
public function setContentLengthHeader(ResponseEvent $event): void {
$response = $event->getResponse();
$response = $event->getResponse();
if ($response instanceof StreamedResponse) {
 
if ($response->isInformational() || $response->isServerError() || $response->isEmpty()) {
 
return;
 
}
 
 
if ($response->headers->has('Transfer-Encoding')) {
 
return;
 
}
 
 
$content = $response->getContent();
 
if ($content === FALSE) {
return;
return;
}
}
$response->headers->set('Content-Length', strlen($response->getContent()), TRUE);
$response->headers->set('Content-Length', strlen($content), TRUE);
}
}
/**
/**
Loading