You are here

protected function MobileDeviceDetection::setUserAgentHeaders in Mobile Device Detection 8.2

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

File

src/Object/MobileDeviceDetection.php, line 150

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';
  }
}