From 72af09fe0c49107e121222bdb04ce7ec5b4c4800 Mon Sep 17 00:00:00 2001 From: Tim Kelty Date: Wed, 17 Jul 2024 13:05:03 -0400 Subject: [PATCH] Use getActionId for correct ID when CORS filter is attached to a module --- framework/filters/Cors.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/filters/Cors.php b/framework/filters/Cors.php index b6b99a79bfc..c377dcb0994 100644 --- a/framework/filters/Cors.php +++ b/framework/filters/Cors.php @@ -123,8 +123,10 @@ public function beforeAction($action) */ public function overrideDefaultSettings($action) { - if (isset($this->actions[$action->id])) { - $actionParams = $this->actions[$action->id]; + $actionId = $this->getActionId($action); + + if (isset($this->actions[$actionId])) { + $actionParams = $this->actions[$actionId]; $actionParamsKeys = array_keys($actionParams); foreach ($this->cors as $headerField => $headerValue) { if (in_array($headerField, $actionParamsKeys)) {