You are here

public function EnforcedFormResponseSubscriber::onKernelResponse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/EventSubscriber/EnforcedFormResponseSubscriber.php \Drupal\Core\EventSubscriber\EnforcedFormResponseSubscriber::onKernelResponse()

Unwraps an enforced response.

File

core/lib/Drupal/Core/EventSubscriber/EnforcedFormResponseSubscriber.php, line 35
Contains \Drupal\Core\EventSubscriber\EnforcedFormResponseSubscriber.

Class

EnforcedFormResponseSubscriber
Handle the EnforcedResponseException and deliver an EnforcedResponse.

Namespace

Drupal\Core\EventSubscriber

Code

public function onKernelResponse(FilterResponseEvent $event) {
  $response = $event
    ->getResponse();
  if ($response instanceof EnforcedResponse && $event
    ->getRequestType() === HttpKernelInterface::MASTER_REQUEST) {
    $event
      ->setResponse($response
      ->getResponse());
  }
}