guild/frontend/modules/api/controllers/ApiController.php
2021-11-29 18:21:50 +03:00

30 lines
720 B
PHP

<?php
namespace frontend\modules\api\controllers;
use common\behaviors\GsCors;
use yii\rest\Controller;
class ApiController extends Controller
{
public function behaviors()
{
return [
'corsFilter' => [
'class' => GsCors::class,
'cors' => [
'Origin' => ['*'],
//'Access-Control-Allow-Credentials' => true,
'Access-Control-Allow-Headers' => [
'Content-Type',
'Access-Control-Allow-Headers',
'Authorization',
'X-Requested-With'
],
]
],
];
}
}