You are here

public function ResponseSubscriber::onResponse in Commerce Core 8.2

Sets extra X-Commerce-Core header on successful responses.

Parameters

\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event: The event to process.

File

src/EventSubscriber/ResponseSubscriber.php, line 28

Class

ResponseSubscriber
Response subscriber to add the "X-Commerce-Core" header tag.

Namespace

Drupal\commerce\EventSubscriber

Code

public function onResponse(FilterResponseEvent $event) {
  if (!$event
    ->isMasterRequest()) {
    return;
  }
  $response = $event
    ->getResponse();
  $response->headers
    ->set('X-Commerce-Core', '2');
}