Answer the question
In order to leave comments, you need to log in
Why does the cors filter only work on *?
If origin = * , then everything loads, but if I write the domain, then the page is blocked, why?
public function behaviors()
{
return [
'corsFilter' => [
'class' => \yii\filters\Cors::className(),
'cors' => [
'Origin' => ['https://test.test.ru'],
'Access-Control-Request-Method' => ['POST'],
],
],
];
}
Answer the question
In order to leave comments, you need to log in
You need to specify domains from which requests can be made in the Access-Control-Allow-Origin header. Origin is the request header
More about CORS
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question