fix CORSE add Access-Control-Allow-Origin to Headers

This commit is contained in:
iIronside 2023-01-13 15:46:15 +03:00
parent 1394e89d45
commit 55f412c8eb
3 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ class ApiController extends Controller
'Origin' => ['*'], 'Origin' => ['*'],
//'Access-Control-Allow-Credentials' => true, //'Access-Control-Allow-Credentials' => true,
'Access-Control-Allow-Headers' => [ 'Access-Control-Allow-Headers' => [
'Access-Control-Allow-Origin',
'Content-Type', 'Content-Type',
'Access-Control-Allow-Headers', 'Access-Control-Allow-Headers',
'Authorization', 'Authorization',

View File

@ -18,7 +18,7 @@ class ProfileController extends ApiController
'verbs' => [ 'verbs' => [
'class' => \yii\filters\VerbFilter::class, 'class' => \yii\filters\VerbFilter::class,
'actions' => [ 'actions' => [
'' => ['get'], '' => ['GET', 'HEAD', 'OPTIONS'],
'profile-with-report-permission' => ['post', 'patch'], 'profile-with-report-permission' => ['post', 'patch'],
'get-main-data' => ['get'] 'get-main-data' => ['get']
], ],

View File

@ -32,6 +32,7 @@ class UserController extends ActiveController
'Origin' => ['*'], 'Origin' => ['*'],
//'Access-Control-Allow-Credentials' => true, //'Access-Control-Allow-Credentials' => true,
'Access-Control-Allow-Headers' => [ 'Access-Control-Allow-Headers' => [
'Access-Control-Allow-Origin',
'Content-Type', 'Content-Type',
'Access-Control-Allow-Headers', 'Access-Control-Allow-Headers',
'Authorization', 'Authorization',