Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / eu_cookie_compliance / src / Controller / CheckIfEuCountryJsController.php
1 <?php
2
3 namespace Drupal\eu_cookie_compliance\Controller;
4
5 use Drupal\Core\Controller\ControllerBase;
6 use Symfony\Component\HttpFoundation\JsonResponse;
7
8 /**
9  * Controller for JS call that checks if the visitor is in the EU.
10  */
11 class CheckIfEuCountryJsController extends ControllerBase {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function content() {
17     $data = eu_cookie_compliance_user_in_eu();
18
19     // Allow other modules to alter the geo IP matching logic.
20     \Drupal::moduleHandler()->alter('eu_cookie_compliance_geoip_match', $data);
21
22     return new JsonResponse($data, 200, ['Cache-Control' => 'private']);
23   }
24
25 }