public/index.php line 36

Open in your IDE?
  1. <?php
  2. //$http_origin = isset($_SERVER['HTTP_ORIGIN']) AND is_string($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : null;
  3. $http_origin is_string($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : null;
  4. $allowed = [
  5.     'http://quiz.local',
  6.     'http://localhost:5173',
  7.     'http://dev.puzzlax.co',
  8.     'https://dev.puzzlax.co',
  9.     'http://68.183.12.30',
  10.     'https://68.183.12.30',
  11.     'http://react.puzzlax.co',
  12.     'https://react.puzzlax.co',
  13.     'http://64.225.70.198',
  14.     'https://64.225.70.198',
  15.     'http://react.puzzlax.com',
  16.     'https://react.puzzlax.com',
  17.     'http://www.puzzlax.com',
  18.     'https://www.puzzlax.com',
  19.     'http://api.puzzlax.com',
  20.     'https://api.puzzlax.com',
  21.     'http://puzzlax.com',
  22.     'https://puzzlax.com',
  23.     'https://partnera.react.puzzlax.co',
  24. ];
  25. if (in_array($http_origin$allowed)) {
  26.     header("Access-Control-Allow-Origin: $http_origin");
  27. } else {
  28.     header('Access-Control-Allow-Origin: *');
  29. }
  30. header("Access-Control-Allow-Headers: RF-Program-Url, Authorization, X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
  31. header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
  32. header("Allow: GET, POST, OPTIONS, PUT, DELETE");
  33. use App\Kernel;
  34. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  35. return function (array $context) {
  36.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  37. };