@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use app\models\User; |
6 | 6 | use yrc\rest\Action as RestAction; |
7 | - |
|
8 | 7 | use yii\web\HttpException; |
9 | 8 | use Yii; |
10 | 9 |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | { |
48 | 48 | $behaviors = parent::behaviors(); |
49 | 49 | |
50 | - $authenticator = false; |
|
50 | + $authenticator = false; |
|
51 | 51 | |
52 | - if (isset($behaviors['authenticator'])) { |
|
53 | - $authenticator = $behaviors['authenticator']; |
|
54 | - unset($behaviors['authenticator']); |
|
55 | - } |
|
52 | + if (isset($behaviors['authenticator'])) { |
|
53 | + $authenticator = $behaviors['authenticator']; |
|
54 | + unset($behaviors['authenticator']); |
|
55 | + } |
|
56 | 56 | |
57 | 57 | $behaviors['corsFilter'] = [ |
58 | 58 | 'class' => Cors::className(), |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | 'Access-Control-Request-Method' => $this->getHttpVerbMethodsFromClass($this->actions()[$this->action->id]), |
62 | 62 | 'Access-Control-Request-Headers' => ['*'], |
63 | 63 | 'Access-Control-Expose-Headers' => [ |
64 | - 'Access-Control-Allow-Origin', |
|
64 | + 'Access-Control-Allow-Origin', |
|
65 | 65 | 'X-Pagination-Per-Page', |
66 | 66 | 'X-Pagination-Total-Count', |
67 | 67 | 'X-Pagination-Current-Page', |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | 'enableRateLimitHeaders' => true |
85 | 85 | ]; |
86 | 86 | |
87 | - if ($authenticator != false) { |
|
88 | - $behaviors['authenticator'] = $authenticator; |
|
89 | - $behaviors['authenticator']['except'] = ['options']; |
|
90 | - } |
|
87 | + if ($authenticator != false) { |
|
88 | + $behaviors['authenticator'] = $authenticator; |
|
89 | + $behaviors['authenticator']['except'] = ['options']; |
|
90 | + } |
|
91 | 91 | |
92 | - // Manually add the ACAO header because Yii2 is terrible at doing it |
|
93 | - header("Access-Control-Allow-Origin: " . \implode(',', $behaviors['corsFilter']['cors']['Origin'])); |
|
92 | + // Manually add the ACAO header because Yii2 is terrible at doing it |
|
93 | + header("Access-Control-Allow-Origin: " . \implode(',', $behaviors['corsFilter']['cors']['Origin'])); |
|
94 | 94 | return $behaviors; |
95 | 95 | } |
96 | 96 |