Answer the question
In order to leave comments, you need to log in
Why doesn't the cors filter work for me?
How to properly write a cors filter for a controller.
Here is my example
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
'corsFilter' => [
'class' => Cors::className(),
'cors' => [
'Origin' => ['http://localhost:3001/socket.io/1/?t=1503580684584'],
'Access-Control-Request-Method' => ['GET'],
'Access-Control-Allow-Credentials' => true,
]
],
];
}
GET localhost:3001/socket.io/1/?t=1503582467989 403 (Forbidden)
XMLHttpRequest cannot load localhost:3001/socket.io/1/?t=1503582467989. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' crm ' is therefore not allowed access. The response had HTTP status code 403.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question