You are here

public function SecKitEventSubscriber::seckitReferrerPolicy in Security Kit 8

Same name and namespace in other branches
  1. 2.x src/EventSubscriber/SecKitEventSubscriber.php \Drupal\seckit\EventSubscriber\SecKitEventSubscriber::seckitReferrerPolicy()

Sends Referrer-Policy HTTP response header.

Implementation is based on specification draft available at https://www.w3.org/TR/referrer-policy.

1 call to SecKitEventSubscriber::seckitReferrerPolicy()
SecKitEventSubscriber::onKernelResponse in src/EventSubscriber/SecKitEventSubscriber.php
Executes actions on the response event.

File

src/EventSubscriber/SecKitEventSubscriber.php, line 469

Class

SecKitEventSubscriber
Subscribing an event.

Namespace

Drupal\seckit\EventSubscriber

Code

public function seckitReferrerPolicy() {
  $value = $this->config
    ->get('seckit_various.referrer_policy_policy');
  $this->response->headers
    ->set('Referrer-Policy', $value);
}