Skip to content

Commit

Permalink
internal(filter): add filter to handle CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Jul 28, 2023
1 parent e26b71f commit c77341f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/Config/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use CodeIgniter\Filters\Honeypot;
use CodeIgniter\Filters\InvalidChars;
use CodeIgniter\Filters\SecureHeaders;
use Fluent\Cors\Filters\CorsFilter;

use App\Filters\EnsureOwnership;

Expand All @@ -18,12 +19,13 @@ class Filters extends BaseConfig
* make reading things nicer and simpler.
*/
public array $aliases = [
"csrf" => CSRF::class,
"toolbar" => DebugToolbar::class,
"honeypot" => Honeypot::class,
"invalidchars" => InvalidChars::class,
"csrf" => CSRF::class,
"toolbar" => DebugToolbar::class,
"honeypot" => Honeypot::class,
"invalidchars" => InvalidChars::class,
"secureheaders" => SecureHeaders::class,
"ensure_ownership" => EnsureOwnership::class,
"cors" => CorsFilter::class,
];

/**
Expand All @@ -43,9 +45,11 @@ class Filters extends BaseConfig
"auth/a/*"
]
],
"cors",
],
"after" => [
"toolbar",
"cors",
// "honeypot",
// "secureheaders",
],
Expand Down

0 comments on commit c77341f

Please sign in to comment.