You are here

protected function MobileDeviceDetection::setUserAgentHeaders in Mobile Device Detection 8.3

Same name and namespace in other branches
  1. 8.2 src/Object/MobileDeviceDetection.php \Drupal\mobile_device_detection\Object\MobileDeviceDetection::setUserAgentHeaders()

Set user agent headers.

1 call to MobileDeviceDetection::setUserAgentHeaders()
MobileDeviceDetection::init in src/Object/MobileDeviceDetection.php
Initialization.

File

src/Object/MobileDeviceDetection.php, line 175

Class

MobileDeviceDetection
MobileDeviceDetection object.

Namespace

Drupal\mobile_device_detection\Object

Code

protected function setUserAgentHeaders($headers) {
  $this->userAgentHeaders = implode(' ', array_intersect_key($this
    ->getMobileHeaders(), array_flip($headers)));
  if (!$this->userAgentHeaders && !empty($this
    ->getCloudHeaders())) {
    $this->userAgentHeaders = 'Amazon CloudFront';
  }
}