Skip to content

Commit

Permalink
Attaching CORS filter by default to Yiisoft\Yii\Rest\Controller yiiso…
Browse files Browse the repository at this point in the history
  • Loading branch information
tunecino authored Aug 27, 2019
1 parent bc2d8e8 commit 346dfc8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use yii\web\filters\ContentNegotiator;
use yii\web\filters\RateLimiter;
use yii\web\filters\VerbFilter;
use yii\web\filters\Cors;
use yii\web\Response;
use yii\base\Action;

Expand Down Expand Up @@ -56,6 +57,9 @@ public function behaviors()
'application/xml' => Response::FORMAT_XML,
],
],
'cors' => [
'__class' => Cors::class,
],
'verbFilter' => [
'__class' => VerbFilter::class,
'actions' => $this->verbs(),
Expand Down

0 comments on commit 346dfc8

Please sign in to comment.