You are here

protected function Cdn::checkCloudflare in GeoIP API 8.2

Check for Cloudflare geolocation header.

Return value

string The country code specified in the header.

1 call to Cdn::checkCloudflare()
Cdn::geolocate in src/Plugin/GeoLocator/Cdn.php
Performs geolocation on an address.

File

src/Plugin/GeoLocator/Cdn.php, line 58

Class

Cdn
CDN geolocation provider.

Namespace

Drupal\geoip\Plugin\GeoLocator

Code

protected function checkCloudflare() {
  return !empty($_SERVER['HTTP_CF_IPCOUNTRY']) ? $_SERVER['HTTP_CF_IPCOUNTRY'] : NULL;
}