diff --git a/application/onlinechip/controller/Pcapi.php b/application/onlinechip/controller/Pcapi.php index 925e39d..76b8ac8 100755 --- a/application/onlinechip/controller/Pcapi.php +++ b/application/onlinechip/controller/Pcapi.php @@ -23,13 +23,13 @@ class Pcapi extends Controller{ parent::__construct(); // CORS headers $origin = Request::instance()->header('origin'); - $allowed = ['https://ww1.g7g7.top','https://m.g7g7.top','https://m1.g7g7.top','https://m3.g7g7.top','https://p.g7g7.top']; - if($origin && in_array($origin, $allowed)){ + if($origin){ header('Access-Control-Allow-Origin: '.$origin); - header('Access-Control-Allow-Headers: token, Origin, X-Requested-With, Content-Type, Accept, Authorization'); - header('Access-Control-Allow-Methods: POST,GET,PUT,DELETE,OPTIONS'); - header('Access-Control-Allow-Credentials: true'); + } else { + header('Access-Control-Allow-Origin: *'); } + header('Access-Control-Allow-Headers: token, Origin, X-Requested-With, Content-Type, Accept, Authorization'); + header('Access-Control-Allow-Methods: POST,GET,PUT,DELETE,OPTIONS'); if(Request::instance()->isOptions()){ exit(); }