diff --git a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php index 6d2f48f..cb5cd28 100644 --- a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php @@ -146,6 +146,10 @@ protected function makeSubrequest(GetResponseForExceptionEvent $event, $url, $st $response = $this->httpKernel->handle($sub_request, HttpKernelInterface::SUB_REQUEST); $response->setStatusCode($status_code); + + // Persist any special HTTP headers that were set on the exception. + $response->headers->add($event->getException()->getHeaders()); + $event->setResponse($response); } catch (\Exception $e) {