fitness-web/common/helpers/CorsCustom.php
Roland Schneider dcf620f191 bug fixing
2021-09-28 19:32:39 +02:00

26 lines
404 B
PHP

<?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;
}
}