bug fixing

This commit is contained in:
Roland Schneider
2021-09-28 19:32:39 +02:00
parent 12f49e2362
commit dcf620f191
3 changed files with 29 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace common\helpers;
use Yii;
use yii\filters\Cors;
class CorsCustom extends Cors
{
public function beforeAction($action){
parent::beforeAction($action);
if (Yii::$app->getRequest()->getMethod() === 'OPTIONS') {
Yii::$app->getResponse()->getHeaders()->set('Allow', 'POST GET PUT');
Yii::$app->end();
}
return true;
}
}