guild/common/behaviors/GsCors.php

22 lines
453 B
PHP
Raw Permalink Normal View History

2021-06-14 17:26:05 +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;
}
}