personal_area_php/common/behaviors/GsCors.php
2024-05-24 15:27:07 +03:00

22 lines
453 B
PHP
Executable File

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