Commit f31bfd1f by Philippe Gaultier

Allow the user to override the request like in RateLimiter

parent 62f43e17
......@@ -88,8 +88,9 @@ class Cors extends ActionFilter
*/
public function beforeAction($action)
{
$this->request = Yii::$app->getRequest();
$this->response = Yii::$app->getResponse();
$this->request = $this->request ? : Yii::$app->getRequest();
$this->response = $this->response ? : Yii::$app->getResponse();
$this->overrideDefaultSettings($action);
$requestCorsHeaders = $this->extractHeaders($this->request);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment