personal_area_php/common/behaviors/GsCors.php

22 lines
453 B
PHP
Raw Permalink Normal View History

2024-05-24 15:27:07 +03:00
<?php
namespace common\behaviors;
use yii\filters\Cors;
class GsCors extends Cors
{
public function prepareHeaders($requestHeaders){
$responseHeaders = parent::prepareHeaders($requestHeaders);
if (isset($this->cors['Access-Control-Allow-Headers'])) {
$responseHeaders['Access-Control-Allow-Headers'] = implode(', ', $this->cors['Access-Control-Allow-Headers']);
}
return $responseHeaders;
}
}