You are here

public function WebformShareEventSubscriber::onResponse in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_share/src/EventSubscriber/WebformShareEventSubscriber.php \Drupal\webform_share\EventSubscriber\WebformShareEventSubscriber::onResponse()

Remove 'X-Frame-Options' from the response header for shared webforms.

Parameters

\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event: The response event.

File

modules/webform_share/src/EventSubscriber/WebformShareEventSubscriber.php, line 39

Class

WebformShareEventSubscriber
Event subscriber to allow webform to be shared via an iframe.

Namespace

Drupal\webform_share\EventSubscriber

Code

public function onResponse(FilterResponseEvent $event) {
  if (!WebformShareHelper::isPage($this->routeMatch)) {
    return;
  }
  $response = $event
    ->getResponse();
  $response->headers
    ->remove('X-Frame-Options');
}