From 55f412c8ebb0dd379053a0cee9ee6f57c98d5af4 Mon Sep 17 00:00:00 2001 From: iIronside Date: Fri, 13 Jan 2023 15:46:15 +0300 Subject: [PATCH] fix CORSE add Access-Control-Allow-Origin to Headers --- frontend/modules/api/controllers/ApiController.php | 1 + frontend/modules/api/controllers/ProfileController.php | 2 +- frontend/modules/api/controllers/UserController.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/modules/api/controllers/ApiController.php b/frontend/modules/api/controllers/ApiController.php index 81fd9f9..eec0b03 100644 --- a/frontend/modules/api/controllers/ApiController.php +++ b/frontend/modules/api/controllers/ApiController.php @@ -21,6 +21,7 @@ class ApiController extends Controller 'Origin' => ['*'], //'Access-Control-Allow-Credentials' => true, 'Access-Control-Allow-Headers' => [ + 'Access-Control-Allow-Origin', 'Content-Type', 'Access-Control-Allow-Headers', 'Authorization', diff --git a/frontend/modules/api/controllers/ProfileController.php b/frontend/modules/api/controllers/ProfileController.php index f8fa565..cd0b7e7 100755 --- a/frontend/modules/api/controllers/ProfileController.php +++ b/frontend/modules/api/controllers/ProfileController.php @@ -18,7 +18,7 @@ class ProfileController extends ApiController 'verbs' => [ 'class' => \yii\filters\VerbFilter::class, 'actions' => [ - '' => ['get'], + '' => ['GET', 'HEAD', 'OPTIONS'], 'profile-with-report-permission' => ['post', 'patch'], 'get-main-data' => ['get'] ], diff --git a/frontend/modules/api/controllers/UserController.php b/frontend/modules/api/controllers/UserController.php index a93b69b..375951f 100755 --- a/frontend/modules/api/controllers/UserController.php +++ b/frontend/modules/api/controllers/UserController.php @@ -32,6 +32,7 @@ class UserController extends ActiveController 'Origin' => ['*'], //'Access-Control-Allow-Credentials' => true, 'Access-Control-Allow-Headers' => [ + 'Access-Control-Allow-Origin', 'Content-Type', 'Access-Control-Allow-Headers', 'Authorization',