I have an issue with the CORS header not being added to the response. I’m using the ‘cors’ from the package \yii\filters\Cors
Basically, I’m doing this :
class ApiController extends ActiveController
{
public function behaviors() {
return array_merge(parent::behaviors(), [
// For cross-domain AJAX request
‘corsFilter’ => [
‘class’ => \yii\filters\Cors::className(),
‘cors’ => [
// restrict access to domains:
‘Origin’ => [
“*”
],
‘Access-Control-Request-Method’ => [‘POST’, ‘HEAD’, ‘DELETE’, ‘PUT’, ‘GET’, ‘OPTIONS’],
‘Access-Control-Allow-Credentials’ => true,
‘Access-Control-Request-Headers’ => [’*’],
‘Access-Control-Allow-Origin’ => true,
‘Access-Control-Expose-Headers’ => [’*’],
‘Access-Control-Max-Age’ => 3600, // Cache (seconds)
],
],
]);
}
And I still have the same result as without applying this method… No CORS headers are added to the Response of the OPTIONS query to my endpoint.
Anyone else having/had that issue ?