Skip to content

Commit

Permalink
Use getActionId for correct ID when CORS filter is attached to a module
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed Jul 17, 2024
1 parent 4b0a02e commit 72af09f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions framework/filters/Cors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Check warning on line 129 in framework/filters/Cors.php

View check run for this annotation

Codecov / codecov/patch

framework/filters/Cors.php#L129

Added line #L129 was not covered by tests
$actionParamsKeys = array_keys($actionParams);
foreach ($this->cors as $headerField => $headerValue) {
if (in_array($headerField, $actionParamsKeys)) {
Expand Down

0 comments on commit 72af09f

Please sign in to comment.