This commit is contained in:
andrey
2021-11-29 18:21:50 +03:00
parent fd384ec957
commit 57cb9df4bf
5 changed files with 66 additions and 63 deletions

View File

@ -0,0 +1,30 @@
<?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'
],
]
],
];
}
}