You are here

public function KillXFrameOptions::onKernelResponse in Acquia Content Hub 8.2

Filter X-Frame-Options on Kernel Response.

Parameters

\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event: The Filter Response Event.

File

modules/acquia_contenthub_preview/src/EventSubscriber/KernelResponse/KillXFrameOptions.php, line 31

Class

KillXFrameOptions
Removes the x-frame-options header from previews.

Namespace

Drupal\acquia_contenthub_preview\EventSubscriber\KernelResponse

Code

public function onKernelResponse(FilterResponseEvent $event) {
  $response = $event
    ->getResponse();
  $response->headers
    ->remove('X-Frame-Options');
}